|
Post by meerkat on Aug 25, 2020 8:02:37 GMT -5
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.
Thanks for the help.. Dan
|
|
|
Post by metro on Aug 25, 2020 18:58:48 GMT -5
G'Day Dan, I probably have miss understood the problem, I do not seem to have the issue you describe.
dim dbGrid$(1,10) dbGrid$(0,0)= "Customers" WindowWidth=900 WindowHeight=650 grid #main.gDb, dbGrid$(),[useDb] ,010,110,120,224 ' database grid button #main.bDbSql, "Sql", [sql] ,UL,205,350,065,025
open "Grid test" for window as #main #main.gDb columnwidths(100) wait
[useDb] print "at [useDb]" 'print "clicked: "; #main.gDb cellxy$() db1$ = #main.gDb value$() print db1$
xy$ = #main.gDb cellxy$() #main.gDb selectxy(x,y)
wait ' ------------------------ [sql] print "Database is :";db1$ print "------------" if db1$ = "" then notice "Please select a Database" wait end if print "Why am I here"
|
|
|
Post by Chris Iverson on Aug 25, 2020 19:19:05 GMT -5
|
|
|
Post by metro on Aug 25, 2020 19:30:05 GMT -5
I do see the problem using Chris's code from his thread when using lb5-350(Linux & Win/Wine). But that same code in lb5-351(Linux & Win/Wine) works as it should for me
|
|
|
Post by Carl Gundel on Aug 25, 2020 21:58:47 GMT -5
I do see the problem using Chris's code from his thread when using lb5-350(Linux & Win/Wine). But that same code in lb5-351(Linux & Win/Wine) works as it should for me
Maybe related to this from the build 351 notes? - Fixed a bug where WAIT was ineffective when inside an IF/THEN/ELSE block. This might have seemed like a TIMER bug but it wasn't.
|
|
|
Post by Chris Iverson on Aug 25, 2020 22:05:56 GMT -5
My bad 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?
|
|
|
Post by meerkat on Aug 26, 2020 1:43:24 GMT -5
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
|
|
|
Post by metro on Aug 26, 2020 2:28:41 GMT -5
I do see the problem using Chris's code from his thread when using lb5-350(Linux & Win/Wine). But that same code in lb5-351(Linux & Win/Wine) works as it should for me
Maybe related to this from the build 351 notes? - Fixed a bug where WAIT was ineffective when inside an IF/THEN/ELSE block. This might have seemed like a TIMER bug but it wasn't. I only read instructions after all else fails.....apparently it's a male thing according to my domestic goddess
|
|
|
Post by meerkat on Aug 26, 2020 11:40:46 GMT -5
Probably not a bad idea. And I don't ask for directions either..
Sorry for the late reply. The fires here in California have knocked out one of the cable stations.
One more question. I looked and don't see anything. Not sure this is a bug or a feature. When clearing a textarea I use "!cls". To clear a textbox I set it to blank.
If you set the textarea to blank it puts a chr$(13) in the field. Is this a feature?? If so I don't like it much..
Dan
|
|
|
Post by Chris Iverson on Aug 26, 2020 11:50:52 GMT -5
What's the code you're using to set the textarea contents?
And does it still do it if you add a semicolon to the end?
I wonder if it's doing the same thing as files, where it automatically adds a line break for each PRINT(or implied PRINT) unless you explicitly surpress it.
|
|
|
Post by meerkat on Aug 26, 2020 12:09:15 GMT -5
And does it still do it if you add a semicolon to the end?
Thanks chris.. That's exactly what it's doing. I forgot that there is a implied print.
Works now..
Thanks for the help.
|
|