Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
PRINT "Start two processes"
CG ReadFile 'This will goto ReadFile but also immediately continue
OPEN "OutFile.dat" for output as #2
do
line input "Enter message to be saved: "; M$
if M$="" then exit do
print #2, m$
loop
close #2
END Me ' This would end only this task
ReadFile:
OPEN "InFile.dat" for input as #1
do
if EOF(1) then exit do
line INPUT #1, l$
print l$
line input "Read another line? "; a$
loop while ucase$(a$)="Y"
close #1
End Me ' This would end only this task
Dim Status as string*1 ' Identity of the task currently expecting user input
call Task1(""): call Task2("") ' Each will return when it needs a character
do
k$=inkey$
if k$=(some key that means swap tasks) then
if Status=1 then Status=2
elseif k$<>"" then
if Status=1 then call Task1(k$) else call Task2(k$)
endif
loop
Dim Status as string*1 ' Identity of the task currently expecting user input
call Task1(""): call Task2("") ' Each will return when it needs a character
do
k$=inkey$
if k$=(some key that means swap tasks) then
if Status=1 then Status=2
elseif k$<>"" then
if Status=1 then call Task1(k$) else call Task2(k$)
endif
loop