Menus - How to do selections with diffrent outcomes

GFA BASIC-related articles in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
WireLord55
Atari freak
Atari freak
Posts: 52
Joined: Sun Apr 22, 2018 9:48 am

Menus - How to do selections with diffrent outcomes

Postby WireLord55 » Sun Apr 29, 2018 8:21 am

Hi all,

Iv'e been creating menus in GFA and i've found that i cannot click menu items once without the same result occurring. I cannot find a way to fix this.

Why doesn't this work (for having different menu items)?

Code: Select all

ON entry$="Quit" GOSUB eval01
ON entry$="About" GOSUB eval02
'
REPEAT
    ON MENU
LOOP UNTIL MOUSEK AND 2
'
PROCEDURE eval01
    OPEN #1,0,0,200,200,0
    DO
        PRINT "Menu stuff"
        KEYGET n
    LOOP UNTIL n=3735584
CLOSE #1
RETURN
'
PROCEDURE eval02
    OPEN #1,0,0,300,300,0
    DO
        PRINT "Menu stuff is great"
        KEYGET n
    LOOP UNTIL n=3735584
CLOSE #1
RETURN


On a side note and .TXT to .GFA converters out there and vice versa?

Thanks,

Wirelord55
You do not have the required permissions to view the files attached to this post.
"Do...or do not. There is no try" - Yoda, Episode V

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5020
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Menus - How to do selections with diffrent outcomes

Postby simonsunnyboy » Mon Apr 30, 2018 9:16 am

a) You cannot assign values in the ON ... GOSUB statement, only evaluate variables.
b) ON ... GOSUB only works with numerical variables, not strings.
c) I wonder if your REPEAT statement is valid, the canonical form is REPEAT ... UNTIL without the LOOP, LOOP is only used with DO ... LOOP statements.
d) GFABASIC itself already imports and exports .LST files. These are plain text. Use MERGE to load one and SAVE,A to create one.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
WireLord55
Atari freak
Atari freak
Posts: 52
Joined: Sun Apr 22, 2018 9:48 am

Re: Menus - How to do selections with diffrent outcomes

Postby WireLord55 » Tue May 01, 2018 12:35 am

I love you. (in a joking way)

Thanks,

WireLord55
"Do...or do not. There is no try" - Yoda, Episode V


Social Media

     

Return to “GFA BASIC”

Who is online

Users browsing this forum: No registered users and 2 guests