• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

MQ2 arrays (1 Viewer)

edud

Member
Joined
Apr 5, 2006
RedCents
31¢
Hi there,
im not sure if this is possible but im trying to make an array from a random string
ie

mystring = TEST

myarray[0] = T
myarray[1] = E
myarray[2] = S
myarray[3] = T

any help would be appreciated
 
im trying to make a macro that has user input before the macro is run like
/macro mymacro TEST

then i want to take the variable, (in example, TEST) and split it at each letter and end up with an array as mentioned above

hope this makes better sense
 
This is made of the top of my head. Untested.

Rich (BB code):
Sub Main(string myString)
    /declare lnString               int     local   ${myString.Length}
    /declare arString[${lnString}]  string  local
    /declare i                      int     local   0
    /for i 1 to ${lnString}
        /varset arString[${i}] ${myString.Mid[${i},1]}
    /next i
/return
 
Last edited:
MQ2 arrays

Users who are viewing this thread

Back
Top