Error in loop

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
xavram
Dragon
Posts: 891
Joined: Tue Apr 20, 2010 8:22 pm

Error in loop

Post by xavram »

This is weird, I have these loops all over the place without issue but here...

Code: Select all

[r : ISCRunning]
[r, foreach(isc, ISCRunning), code : {
	[r : isc]
}]
...I get a "Error in body of roll.       Statement options (if any): r, foreach(isc, ISCRunning), code       Statement Body : { [h : value = isc] [r : string(value)] }"

ISCRunning = "[10,3]", and that gets outputted to the chat window (first line of macro), so my expectation would be that "10", then "3" would be output to the chat window.

The logic inside the loop is actually a lot more complicated than that, but as I troubleshooting it, I got it down to this very simple function...and still am seeing that error.

Thoughts?

User avatar
Irrlicht
Dragon
Posts: 426
Joined: Mon Feb 09, 2009 10:53 am

Re: Error in loop

Post by Irrlicht »

As far as I can tell, "[10,3]" is not a string list; "10,3" is. I'd suppose the error is there.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Error in loop

Post by wolph42 »

Irrlicht wrote:As far as I can tell, "[10,3]" is not a string list; "10,3" is. I'd suppose the error is there.
there's that.

another thing is that you're showing the wrong part of the code. If I copy paste this in the chat:

Code: Select all

[h:ISCRunning = "[10,3]"]
[r : ISCRunning]<br>
[r, foreach(isc, ISCRunning), code : {
   [r : isc]
}] 
I get no error and an expected result. So my guess is something else is going wrong somewhere else.

also the error result you show:
{ [h : value = isc] [r : string(value)] }
that piece of code is not part of the code you shared, so again: wrong assumption.

Post Reply

Return to “Macros”