custom propertieset woes

Claudi Cornaz claudi.c at fiberworld.nl
Fri May 27 08:37:36 EDT 2005


Hi Xavier,

Here is the script

-- ***
function GatherAllSubs pLine
   put word 2 to -1 of pLine into tGatheredList
   put GetPropName(tGatheredList) into tPropName

   put "put the" && tPropName & "[uSubList]" && "of fld" && quote & 
"topicList" & quote && "into tSubList"  into tCommandStr
   do tCommandStr

   -- tSubList now contains the list exactly as it would appear in the 
topicList fld. Now proces this list
   repeat for each line tTopic in tSubList
     -- each topic might have a.  no subs  b.  closed subs    c. open 
subs
     if last char of word 1 of tTopic is kClosedSubs then
       put cr & GatherAllSubs(tTopic) after tGatheredList
     else
       put cr & word 2 to -1 of tTopic after tGatheredList
     end if
   end repeat
   return tGatheredList
end GatherAllSubs



  pLine will be in the form: ##^  This is topic 1
  word 1 is like a header with some info I use also in other places.
kClosedSubs is a constant for the • char
the function GetPropName() will return the propertie sets name 
associated with "This is topic 1" (or whatever will be in pLine) (so it 
will return like u126543)

After the line "do tCommandStr" I put a line to output tCommandStr to a 
field to see
if there something wrong with it. sample output is: put the 
uCC835628448213[uSubList] of fld "topicList" into tSubList

Copying this line to the msg box (without the "into tSubList" part) it 
works perfectly as expected
returning the right values, but executed in the script it puts strangly 
enough empty into tSubList.
Why would a line of transcript not work as expected in a script, but 
the same line works perfectly well in the msg box?
unless offcourse there is something wrong with the "into tSubList" part.

I also restarted runrev and now it's back to doing only the first 
iteration.

Ps. In my first mail I put u24536 etc in the subList of the set for 
simplicity. In reality I get the sets name via the GetPropName function
'cause in the subList will be text like: ###* And this is another topic
                                                                   #### 
^ and this one is one level deeper

Hope this helps to spot the problem. It has me completly baffled.

Best wishes
Claudi


More information about the use-livecode mailing list