Check all strings in array for use with an if statement in BMS script.

Doubts, help and support about QuickBMS and other game research tools
GHFear
Posts: 290
Joined: Fri Mar 30, 2018 2:48 am

Check all strings in array for use with an if statement in BMS script.

Post by GHFear »

Let's say I have an array of strings and want to make an "if statement" that goes through the entire array and checks if anything match,
how would this be done in a BMS script?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Check all strings in array for use with an if statement in BMS script.

Post by aluigi »

Code: Select all

getarray STRINGS 0 -0x80000000
for i = 0 < STRINGS
    getarray STR 0 i
    if STR & "search"
        print "%STR%"
    endif
next i
GHFear
Posts: 290
Joined: Fri Mar 30, 2018 2:48 am

Re: Check all strings in array for use with an if statement in BMS script.

Post by GHFear »

aluigi wrote:

Code: Select all

getarray STRINGS 0 -0x80000000
for i = 0 < STRINGS
    getarray STR 0 i
    if STR & "search"
        print "%STR%"
    endif
next i


Thank you. :) Will make a lot of things easier and more organized than having over 100 if statements after eachother lol.