UNABLE TO PARSE ERROR "E"

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

BigGuy
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun May 08, 2005 7:01 pm

UNABLE TO PARSE ERROR "E"

Post by BigGuy » Wed Jul 06, 2005 12:05 am

http://www.macroquest2.com/wiki/index.php/Macro_Error

to fix all the ${String[].Equal[Null] problems I looked through the forums and seen several postings on removing the string wrapper from the statement and all should work. When attempting to edit adv_fishing it has the string container wrapped around the ini file and array. when you remove the container it just does not fill the array. This results in all loot being dropped.

The manual showed illustrations for ini and keys but none for arrays. being new to this syntax has me on the bottom of the learning curve somewhat.

I appreciate your patience and look forward to picking this up quickly

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Wed Jul 06, 2005 12:24 am

Code: Select all

/if (${Ini[${FileName},${SectionName},${ArrayType}${nValues}]}.Equal[null]}) {

I belive

dman
a hill giant
a hill giant
Posts: 181
Joined: Fri Dec 05, 2003 12:54 pm

Post by dman » Wed Jul 06, 2005 12:35 am

the ${Ini} Tlo will return a string, your attempted fix sets this string up into a numeric comparison which will fail. A better fix than comparing to null as the macro did, would be to give the Ini variable a default value it returns if the information is not available. The syntax is as follows:

Code: Select all

${Ini[Filename, SectionName, KeyName, default]}
if you look through the macro you can see it does not make use of the default value but would be better off doing so. I would change the macro to be:

Code: Select all

  /if (${Ini[${FileName},${SectionName},${ArrayType}${nValues},NOTFOUND].Equal[NOTFOUND]}) { 
     /varcalc nValues ${nValues}-1 
     /goto :MakeArray 
  } 
  /varcalc nValues ${nValues}+1 
  /goto :CounterLoop 
To directly convert the line as it is without adding anything to it, but not guarenteed to do what you want as Lax posted in another thread comparing vs null isn't the best course of action, try:

Code: Select all

  /if (${Ini[${FileName},${SectionName},${ArrayType}${nValues}].Equal[null]}) { 
     /varcalc nValues ${nValues}-1 
     /goto :MakeArray 
  } 
  /varcalc nValues ${nValues}+1 
  /goto :CounterLoop 

BigGuy
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun May 08, 2005 7:01 pm

Post by BigGuy » Thu Jul 07, 2005 5:54 pm

Thanks for your help. I tried the suggested code but still was not happening then using the suggested code changed to this block:

Code: Select all

:CounterLoop 
   /if (${Ini[${FileName},${SectionName},${ArrayType}${nValues},NULL].Equal[NULL]}) { 
     /varcalc nValues ${nValues}-1 
     /goto :MakeArray 
  } 
  /varcalc nValues ${nValues}+1 
  /goto :CounterLoop 

and worked smoothly. on more peice on the knowledge stack. thanks for your help and consideration.