The stack that I made should display the text line categories. I can set the Categories on the Select Categories card and the settings are saved in an external text file. When opening the stack again the Categories are correctly displayed in the form but on the card where the selection is made the selected check boxes do not correspond to the displayed Categories.
The code on the stack level that is not working for the above:
Code: Select all
global gAllLines,gSelectedCategories
on openStack
put empty into gAllLines
set the itemDelimiter to tab
put fld "alllines" of cd "settingsandfiles" into gAllLines
put empty into gSelectedCategories
set the itemDelimiter to tab -- do I have to set the itemDelimiter here again even though it was set above?
set the defaultFolder to specialFolderPath("Documents")
put URL ("file:./myAppsData.txt") into gSelectedCategories
if "s" is among the items of gSelectedCategories then set the hilite of btn "Short" of cd "select_categories" to true
if "m" is among the items of gSelectedCategories then set the hilite of btn "Medium" of cd "select_categories" to true
if "l" is among the items of gSelectedCategories then set the hilite of btn "Long" of cd "select_categories" to true
end openStack
The code on the Save button on the Select the Categories card is:
Code: Select all
global gAllLines,gSelectedCategories,gMyCategories
on mouseUp
put empty into gSelectedCategories
set the itemDelimiter to tab
if the hilite of btn "Short" is true then put "s" & tab after gSelectedCategories
if the hilite of btn "Medium" is true then put "m" & tab after gSelectedCategories
if the hilite of btn "Long" is true then put "l" & tab after gSelectedCategories
set the defaultFolder to specialFolderPath("Documents")
put gSelectedCategories into URL ("file:./myAppsData.txt")
go back
end mouseUp
I'll appreciate any help to fix it.
Thanks in advance.
keram