[Use-revolution] Re: I Don"t Understand Why This Is

Mark MacKenzie (Shaw) markmac at shaw.ca
Sat Nov 24 13:58:01 EST 2001


Okay I have solved my own problem but in doing so have uncovered a trait of
Rev's which I have some recollection is shared by HC or SuperCard.

My original problem arose because I was putting the "subStacks" directly
into a scrolling list field and then referencing this field line by line in
a repeat structure to get the cardIDs of a multistack project.

Although the resulting list looked good there is something wrong when you
simply grab the line as a variable and use it as a stack reference.

When I changed the manner of putting the substacks into this field by using
the button script:

on mouseup
  local ListOfStacks
  local NumInStackList
  put empty into field "Open Stacks"
  put the substacks of stack "BookCover" into ListOfStacks
  put the number of lines of ListOfStacks into NumInStackList
  if NumInStackList > 0 then
    repeat until NumInStackList = 0
      put line NumInStackList of ListOfStacks & "," after field "Open
Stacks"
      if NumInStackList > 1 then
        put return after field "Open Stacks"
      end if
      subtract 1 from NumInStackList
    end repeat
  end if
end mouseup

I can now work with the resulting field line by line.  I have also inserted
","s so that selecting the first item of the line is possible.

The secondary problem I refer to above is if the "substacks" function
results in a LIST, why cannot this be simply put into a list field directly.
I think I ran into this in HC or such and solved it similarly now that I
think about it.

Although the resulting list field looks similar when viewed in the runtime
there is obviously a structure difference.  What exactly is the structure of
the list returned by "substacks"?

Regards
Mark MacKenzie
Chief Techno-Mage
Historical Treasures & Ancient Arts
www.digitalheritage.ca
markmac at shaw.ca






More information about the use-livecode mailing list