' EndBASIC
' Copyright 2020 Julio Merino
'
' Licensed under the Apache License, Version 2.0 (the "License"); you may not
' use this file except in compliance with the License. You may obtain a copy
' of the License at:
'
' http://www.apache.org/licenses/LICENSE-2.0
'
' Unless required by applicable law or agreed to in writing, software
' distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
' WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
' License for the specific language governing permissions and limitations
' under the License.
' Interactive session editing a program.
EDIT ' Store the program until we get an empty line.
PRINT "Hello!"
PRINT "Good bye."
LIST
RUN
RENUM ' No-op renumbering.
LIST
EDIT 20 ' Edit a single line (ensuring editing stops at that line).
PRINT "Not yet"
PRINT "This is not part of the program"
EDIT 5 ' Insert an intermediate line.
PRINT "Pre-hello"
EDIT 15 ' Insert an intermediate line.
PRINT "Interlude"
EDIT 25 ' Insert an intermediate line.
PRINT "Leaving"
LIST
RENUM ' Make all numbers multiples of ten.
LIST
EDIT ' Append non-blank lines to the program.
PRINT "One more thing"
PRINT "Maybe not"
LIST
EDIT 30 ' Delete an existing line.
LIST
RENUM
LIST
RUN
NEW ' Reset the program.
LIST
EDIT ' Add an invalid line in-between valid ones.
PRINT "before"
THIS IS INVALID
PRINT "after"
RUN
PRINT "Did not abort on RUN error!"