Sorry, but this is a prime example of spaghetti code which results from the use of Goto's. No wonder you can't figure out what's going wrong - I'm having difficulty following it at all!
To the best of my knowledge, the following snippet does what yours does...
load bitmap "men1.bmp",1
set current bitmap 0
hide mouse
sync rate 0: Rem <<< This is the fastest - 500 doesn't do anything
sync on
Do
Gosub Menu1
Loop
End
Menu1:
CLS
set cursor 153,170
copy bitmap 1,0,0,bitmap width(1)-1,bitmap height(1)-1,0,90,150,582,209
input "Enter 1] to enter name or 2] to quit ",ch
if ch=1 then Gosub Menu2
if ch=2 then end
Return
Menu2:
CLS
set cursor 153,170
copy bitmap 1,0,0,bitmap width(1)-1,bitmap height(1)-1,0,90,150,582,209
input "Enter 0 to quit S to save ",g$
g$=Upper$(g$)
if g$="S"
Gosub SaveFile
Else
End
Endif
Return
SaveFile:
cls
set cursor 150,170
copy bitmap 1,0,0,bitmap width(1)-1,bitmap height(1)-1,0,90,150,582,209
input "Enter file name: ",fn$
FileName$ = Lower$(fn$+".txt")
If FileName$ <> "0.txt"
cls
if file exist(fn$+".txt") then delete file fn$+".txt"
make file FileName$
sync
Endif
Return
OK, the problems you were having with your code (apart from leaping about a lot), were:
if g$="s" or g$="s" then goto s2
if g$<>"s" or g$<>"s" then goto 0
What's the difference between "s" and "s" (in both lines)?
if fh$="0" then goto 0
Oops! Where's f
h$ come from lol!
By splitting your code into procedures, you can use Gosub to jump to that section and do the code there. Afterwards, the Return makes the program jump back to the next line after the Gosub. So there's no need for Gotos at all.
And, if something doesn't work, (like the file creation) you know exactly where to go to look for the problem.
In my snippet, you gosub menu1 which then Gosubs menu2 or quits. From menu2 you quit or jump to the create file procedure. After creating the file you drop back down the ladder to menu2, then menu1 and back into the main loop which then gosubs menu1 again ready to create a new file.
One continuous never-ending cycle without a single goto in site - and much easier to follow when things go wrong.
TDK_Man