LOCAL/GLOBAL variables

Previous topic - Next topic

Kitty Hello

What stepping problem?

FutureCow

Sorry, it was at the bottom of my first post.

Quote
Can you also try putting a breakpoint on the very first line of code (LOCAL text$), compile and run in debug mode and see if it works like you'd expect? I'm getting a window with "Loading..." written in it. I've got a feeling it might be related to my previously stepping through the code while up to a MOUSEWAIT command and having that earlier run not exited properly.

Here's the code from the manual again
Code (glbasic) Select
LOCAL text$
text$="LOCAL_MAIN"
GLOBAL text$="GLOBAL"

GOSUB show
PRINT text$, 100, 150
SHOWSCREEN
MOUSEWAIT
END

// ------------------------------------------------------------- //
// -=#  SHOW  #=-
// ------------------------------------------------------------- //
SUB show:
LOCAL text$

// Creating and defining LOCAL arrays:
LOCAL array[]; DIM array[5]

text$="LOCAL_SUB"

PRINT text$, 100, 50
// Is equal to
// PRINT LOCAL text$, 100, 50
PRINT GLOBAL text$, 100, 100
ENDSUB // SHOW