I found that program in LB breaks after handling first event
while in LBB it works OK.
The problem code was function with WAIT inside
Here's the code I came up with.
My guess that in JB/LB
after WAIT program waits on the spot it happened.
That is, inside function.
So no labels are visible that is outside this function (but label inside it are visible - button 1 works, with new label)
But in LBB it looks like always waits on top-level
so on first button, first label always used.
- this is my guess, it might be wrong.
I hope Richard could tell
Now, it is just difference one better be aware of.
Code: Select all
' Form created with the help of Freeform-J v.261006 ' Generated on Apr 13, 2018 at 13:47:19 nomainwin WindowWidth = 344 WindowHeight = 220 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) statictext #main.statictext1, "Press button 1. It will cal WAIT in a function. Now try any button/trapclose. Probably all labels will be unreachable.", 26, 16, 288, 50 statictext #main.statictext1, "(you better close with KillBasic Progam from JB IDE)", 26, 70, 288, 80 button #main.button1, "Button1", [button1Click], UL, 30, 141, 122, 25 button #main.button2, "Button2", [button2Click], UL, 190, 141, 122, 25 open "wait in function - test" for window as #main print #main, "trapclose [quit.main]" print #main, "font ms_sans_serif 10" wait [quit.main] Close #main END [button1Click] 'Perform action for the button named 'button2' notice "Button 1 clicked" dummy = someFunction() wait [button2Click] 'Perform action for the button named 'button3' 'Insert your own code here notice "Button 2 clicked" wait function someFunction() notice "We are in a function" wait 'this one probably should't be done [button1Click] notice "this label1 is available in a function" wait end function