[Use-revolution] I Don't Understand Why This Is
Mark MacKenzie (Shaw)
markmac at shaw.ca
Sat Nov 24 00:50:01 EST 2001
I am developing a tool stack which will eventually give me all the variables
in a multi-stack project. It will read through the script text prior to the
global and local variables being initialized by their first handlers and
list the variables and perhaps allow commenting and if I feel good and lucky
perhaps the instances of their occurrences.
So I have a stack which puts the names of the main stack and substacks of
my project in a field as in:
Field: Open Stacks
Chapters
ImageBank
Illustrations
FullScreenViewer
ThumbnailScroller
VariableTracker
BookCover (This one is the mainstack)
Another button (Get Card IDs) gets the Card IDs and puts them into another
field (Card ID) using this script:
on mouseup
local NumberOfOpenStacks
put empty into NumberOfOpenStacks <--- Redundant I know, put it in as
part of my error trapping
put empty into field "Card ID"
put the number of lines of field "Open Stacks" into NumberOfOpenStacks
put the number of lines of field "Open Stacks" into message
if NumberOfOpenStacks > 0 then
repeat until NumberOfOpenStacks = 0
put the cardIDs of stack (line NumberOfOpenStacks of field "Open
Stacks") & "," & (line NumberOfOpenStacks of field "Open Stacks") after
field "Card ID"
if NumberOfOpenStacks > 1 then
put return after field "Card ID"
end if
subtract 1 from NumberOfOpenStacks
put NumberOfOpenStacks into message
end repeat
end if
end mouseup
Resulting in these results in:
Field Card ID
1002 <--- This should have a "," &
"BookCover"
1013,BookCover
1002,Variable Tracker
1002,ThumbnailScroller
1002,FullScreenViewer
1002,Illustrations
1002,ImageBank
1002 <--- This should have a "," &
"Chapters"
1004 <--- This should have a "," &
"Chapters"
1007,Chapters
As far as I can see when inspecting the stacks and the cards properties
there is nothing which would account for this discrepancy in reporting
behaviour.
Using Rev 1.1 on PC WinME
When I finish this exercise project it will be available for anyone who
wants it.
Regards Mark
More information about the use-livecode
mailing list