not sure how that would help. What I need it for (among other things) is EET on the fly resource conversion code. For example 484 area names need to be checked in BG:EE resources. Currently I'm using rather awkward way to check these references:
1. First variables are set like this:
OUTER_SPRINT resref_are_source1 "AR0002"
//same for all other areas with following index numbers
OUTER_SPRINT resref_are_dest1 "BG0002"
//same for all other areas with following index numbers
OUTER_SET resref_are_total = 484
2. Than macros loops through all resources in BG:EE to update offsets (or modify scripts and dialogues) on the fly, for example like this (another patch macro called by the one that checks resource resref offsets):
READ_ASCII off "resref"
PATCH_IF (NOT ~%resref%~ STR_EQ ~~) BEGIN
SPRINT resref_total ~resref_%res%_total~
SPRINT index_total EVAL ~%%resref_total%%~
FOR (i=1; i<="%index_total%"; i=i+1) BEGIN
SPRINT name_source ~resref_%res%_source%i%~
SPRINT name_dest ~resref_%res%_dest%i%~
SPRINT resref_index_source EVAL ~%%name_source%%~
SPRINT resref_index_dest EVAL ~%%name_dest%%~
PATCH_IF ("%resref%" STR_EQ "%resref_index_source%") BEGIN
SET updated = 1
WRITE_ASCIIE off "%resref_index_dest%" #8
SPRINT str ~Patching %SOURCE_FILESPEC%: %resref_index_source% => %resref_index_dest% -~
SPRINTF str ~%s %x~ ("%str%" off)
PATCH_PRINT ~%str%~
SET i = index_total
END
END
END
When you need to check hundreds of offsets, add to this checks for many types of files, do similar loops also though dialogues and scripts via REPLACE_EVALUATE and so forth than it takes a lot of time. I'm thinking about converting existing code to use PHP_EACH loops to find matches, which I think will be faster than calling and evaluating variables one by one. But to make it even faster it would be great if I could stop that PHP_EACH loop once match is found (like I'm doing in above example code with SET i = index_total)