Thread: Gizmo confusion
View Single Post
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old April 12th, 2013, 05:18 PM
Ok, I cleaned the procedure up a bit, and this error is on a new line.
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 19
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks
Highlighted is line 9.
Code:
<procedure id="sbgadgets" scripttype="synthesize"><![CDATA[

    var ismore as number
    var i as number
    var gadgetid as string
    
    append @boldon & "Gadgets: " & @boldoff & @newline
  
    ~output the details of all resources
    ismore = 0
    
    foreach pick in hero where "HasGadget.?"
      ismore = 1
      gadgetid = "thingid." & eachpick.idstring
      
      append @indent & eachpick.field[name].text & "(" & gadgetid & ")"
      
          
      foreach bootstrap in eachpick.gizmo where "component.Ability"
        notify eachpick.idstring
        nexteach
      
      if (ismore = 0) then
        append @indent & "-none-" & @newline
        endif
        
      append @newline
      nexteach
    
    ~if we have no resources, output that fact
    if (ismore = 0) then
      append @indent & "-none-" & @newline
      endif
    ]]></procedure>
Looking at the wiki, it looks like 'foreach bootstrap' uses eachthing. IfI try this:
Code:
notify eachthing.idstring
I get this:
Quote:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in script for Procedure 'sbgadgets' on line 19
-> Use of 'eachpick.' transition is only valid within a 'foreach' context that iterates picks
TCArknight is offline   #30 Reply With Quote