String variables not being filled with values?

Previous topic - Next topic

fuzzy70

Everything was fine until about an hour ago. For some strange reason when I assign a value to a variable sometimes it does not work. I have loaded some of my projects which worked fine a couple of hours ago & they fail so I wrote the following test program & you can see from the pic whats happening in the debug window.

Only strings seem to be affected & with the included example it is just the global ones but I have seen problems with locals in my other projects. I have un-installed & re-installed GLB yet still the same result  :(. Also tried the clean project & no joy

Code (glbasic) Select

// --------------------------------- //
// Project: test
// Start: Sunday, November 13, 2011
// IDE Version: 10.118


// SETCURRENTDIR("Media") // go to media files

LOCAL ltext1$,ltext2$,ltextarray$[],lnum1%,lnum2#,lnumarray[]

GLOBAL gtext1$,gtext2$,gtextarray$[],gnum1%,gnum2#,gnumarray[]

DIM ltextarray$[4]
DIM gtextarray$[4]
DIM lnumarray[4]
DIM gnumarray[4]

ltext1$="local test string 1"
ltext2$="local test string 2"

ltextarray$[0]="local array test string 1"
ltextarray$[1]="local array test string 2"
ltextarray$[2]="local array test string 3"
ltextarray$[3]="local array test string 4"

lnum1%=1
lnum2#=2.34

lnumarray[0]=1
lnumarray[1]=2
lnumarray[2]=3
lnumarray[3]=4

gtext1$="global test string 1"
gtext2$="global test string 2"

gtextarray$[0]="global array test string 1"
gtextarray$[1]="global array test string 2"
gtextarray$[2]="global array test string 3"
gtextarray$[3]="global array test string 4"

gnum1%=3
gnum2#=4.56

gnumarray[0]=5
gnumarray[1]=6
gnumarray[2]=7
gnumarray[3]=8


Any ideas?

Lee

[attachment deleted by admin]
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

ByteByter

#1
Works for me...sorry  :(
FYI I'm using the latest version 10.159.

[attachment deleted by admin]

MrTAToad

It looks like you put in a breakpoint becfore the program could put anything into the global strings...

But yes, I get that output too with a breakpoint at the end.  However, as using DEBUG outputs the correct string, it does look like a bug in the debugger...




[attachment deleted by admin]

Minion

Excuse my ignorance ... but how exactly do you utilise the debug window on the right ? Ive never seen anything in there even when using debug.

MrTAToad

Easiest way is to define some variables, create a breakpoint on a command and then click on the debug tab...

fuzzy70

Quote from: Minion on 2011-Nov-13
Excuse my ignorance ... but how exactly do you utilise the debug window on the right ? Ive never seen anything in there even when using debug.

I found out by accident lol. Move the mouse to where you want the breakpoint then press the F9 key on your keyboard, you should see a "STOP" graphic appear in the left margin. Run your program  & make sure debug is enabled, When your program reaches that point execution will pause & you will see your variables in the debug window. You can then step through your program with the buttons at the top of the screen :)


In my example I set the break point at the 1st variable & stepped through it 1 line at a time, every variable in the debug window filled in (except the ones I posted obviously) as I stepped through. I also tried setting a breakpoint on the last line out if interest & had the same problem.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)