# Macro Error

With the recent changes for ${String\[ an attempt was made to fix an existing statement.

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

Error:

```
Unparsable in calculation 'E'
adv_fishing.mac@145(ReadINI(FileName,SectionName,ArrayType)):/if ($Ini{$FileName},${SectionName},${ArrayType}${nValues}]}.Equal[null]}){adv_Fishing.mac@41(Main): /call ReadINI FishingLoot.ini "$Zone.Name}" Loot
Failed to parse /if condition (NULL.Equal}), non-numeric encountered.
```

Attempted fixes: assumption - remove string syntax and clear check for null value,

```
/if (${Ini[${FileName},${SectionName},${ArrayType}${nValues}] > 0)
```

this resulted in script working but all loot was dropped, the array was not populated from ini file.

Solution:

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

This was able to make the macro work. I doubt this was the only solution but after some suggestions by others this block of code worked.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macroquest.gitbook.io/macroquest/macros/examples/macro-error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
