I have a program with a window containing grid #main.gDb, dbGrid$(),[useDb] ,010,110,420,224 ' database grid button #main.bDbSql, "Sql", [sql] ,UL,205,350,065,025
And some code [useDb] print "at [useDb]" xy$ = #main.gDb cellxy$() ' sets db1$ = the selected database wait ' ------------------------ [sql] print "db1:";db1$ print "------------" if db1$ = "" then notice "Please select a Database" wait end if print "Why am I here"
Normally the database is selected and it branches to [useDb] and prints "at [useDb]" Sets db1$ to the selected database and everything works. If you click the [sql] button it's possible to do SQL commands for the database selected.
However if you click the [sql] button first without selecting a database it gives notice to "Please select a Database" and waits. Just as it should. If you then select a database it branches to the next line in [sql] and prints "Why am I here". It does not print "at [useDb]" where it should be.
What am I doing wrong? How do I get the database selection to go to the correct label after showing notice.
And yeah, I'm not able to reproduce the issue in 351, either.
Is this issue happening in build 351? And if you don't want to share all your code/db, is there a more compact form you could share that reproduces the glitch?
Don't mind sharing the code. It's just that the program is about 3500 lines.
I have the issue you talked about and I'm using 350.
The code Laurie (metro) posted does exactly what I'm talking about. When I run his code and I click [sql], I get the notice "Please select a Database". Then if I click on the grid I get the message "Why am I here"
So problem solved. I need to download 351 I'm using Liberty BASIC v5.0 alpha - build 350. I'll find out where 351 is and download it.
Thanks for all the help. I need to read the forum more often. Dan