A very frustrating error
Posted: Sun Dec 01, 2013 7:54 pm
So I'm currently trying to make a macro that gets the relative location of a token to a city token. So far it's been going ok but there is one particular problem that makes no sense. I have no idea why the ">=" comparison spits out this error where other comparisons have not. The same comparison works other places in the macro and in other macros, but just not in this case. I am so frustrated with this, it makes no sense at all.
This is the code to the macro:
and this is the error message that appears:
Error in body of roll. Statement options (if any): while (citycount >= counter,""),CODE Statement Body (first 200 characters): { [h: xdist = listGet(dislist, counter)] [h: xname = listGet(citynamelist, counter)] [if(maxdist >= xdist),CODE: { [h: maxdist = xdist] [h: currentcity = xname] }; {};] [h: counter =
Does anyone have any idea what in the world is going on here? Because I have no idea right now.
This is the code to the macro:
Code: Select all
[h: citylist = getWithStateNames("City")]
[h: target = "The Party"]
[h: dislist = ""]
[h: citynamelist = ""]
[h, foreach(city, citylist, ""),CODE:
{
[h: distance = getDistance(target, 1, city, "NO_GRID")]
[h: distance = round(distance,0)]
[h: dislist = listAppend(dislist,distance,",")]
[h: citynamelist = listAppend(citynamelist,city,",")]
}]
[h: counter = 0]
[h: citycount = listCount(citylist)]
[h: currentcity = ""]
[h: maxdist = 24500]
[while (citycount >= counter,""),CODE:
{
[h: xdist = listGet(dislist, counter)]
[h: xname = listGet(citynamelist, counter)]
[if(maxdist >= xdist),CODE:
{
[h: maxdist = xdist]
[h: currentcity = xname]
};
{};]
[h: counter = counter +1]
}]
Error in body of roll. Statement options (if any): while (citycount >= counter,""),CODE Statement Body (first 200 characters): { [h: xdist = listGet(dislist, counter)] [h: xname = listGet(citynamelist, counter)] [if(maxdist >= xdist),CODE: { [h: maxdist = xdist] [h: currentcity = xname] }; {};] [h: counter =
Does anyone have any idea what in the world is going on here? Because I have no idea right now.