Slow loading Option Menus
Posted: Wed Jun 18, 2014 4:32 am
<ridiculously complex lead in>
I have a card with up to 48 groups of controls. In each group of controls is an option menu. Each of the 48 option menus has the same choices available. The available options are set up when a different option menu has a menu item selected.
</ridiculously complex lead in>
This sets up the menu choices and puts them into a variable nGrps:
This is from the first option menu selected. qQuery is a function that returns revDataFromQuery
Once I have this text put into the variable I then need to set the text of the other (up to) 48 option menus:
The name of the option menus follow the pattern "gNum#" 1 through 48
tCInfo is the result of a database query where each line is a group of information used to set the corresponding group of controls
If I comment out the last two lines of the repeat, the whole operation takes just long enough to see it happening, but with the last two lines in it takes close to 5 seconds to complete. Is there a faster way to load the option menus?
thank you,
I have a card with up to 48 groups of controls. In each group of controls is an option menu. Each of the 48 option menus has the same choices available. The available options are set up when a different option menu has a menu item selected.
</ridiculously complex lead in>
This sets up the menu choices and puts them into a variable nGrps:
This is from the first option menu selected. qQuery is a function that returns revDataFromQuery
Code: Select all
--determine the number of groups
put ("SELECT name FROM sqlite_master WHERE type ='table' AND name LIKE 'grp" & pItemName & "%'") into tFind
put qQuery(tFind) into tFound
put the number of lines of tFound into nCount2
repeat with y = 1 to nCount2
put y & cr after nGrps
end repeat
The name of the option menus follow the pattern "gNum#" 1 through 48
tCInfo is the result of a database query where each line is a group of information used to set the corresponding group of controls
Code: Select all
Repeat with x = 1 to nCount1
Put item 2 of line x of tCInfo into fld ("cNum" & x)
If (item 3 of line x of tCInfo) is 1 then
Set the highlited of btn ("alph" & x) to true
Else
Set the highlited of btn ("alph" & x) to false
End if
Put item 4 of line x of tCInfo into fld ("visNum" & x)
set the text of btn ("gNum" & x) to nGrps
set the text of btn ("gNum" & x) to item 6 line x of tCInfo
end Repeat
thank you,