Change lower case alphabetic character colours for save/load code

LoveTD's

New Member
Reaction score
34
Hi all ;) I'm having a little problem with the save/load code of acehart...

I want to make a different collour for the lower case alphabetical characters

so this is what I've come up with:

JASS:
function SaveLoad_Color takes string s returns string
    local integer i = StringLength(s)
    local string c
    local string r = ""

    loop
        set i = i - 1
        set c = SubString(s,i,i + 1)
        if c == "0" or c == "1" or c == "2" or c == "3" or c == "4" or c == "5" or c == "6" or c == "7" or c == "8" or c == "9" then
            set r = "|cffffcc00" + c + "|r" + r
        elseif c == "-" then
            set r = "|cffdddddd-|r" + r
        elseif c == "a" or c == "b" or c == "c" or c == "d" or c == "e" or c == "f" or c == "g" or c == "h" or c == "i" or c == "j" or c == "k" or c == "l" or c == "m" or c == "n" or c == "o" or c == "p" or c == "q" or c == "r" c == "s" or c == "t" or c == "u" or c == "v" or c == "w" or c == "x" or c == "y" or c == "z" then
            set r = "|c0000ff80" + c + "|r" + r
        else
            set r = c + r
        endif
        exitwhen i <= 0
    endloop
    return r
endfunction


the problem is, is that I get 3 compile errors:

Expected expression @:
JASS:
elseif c == "a" or c == "b" or c == "c" or c == "d" or c == "e" or c == "f" or c == "g" or c == "h" or c == "i" or c == "j" or c == "k" or c == "l" or c == "m" or c == "n" or c == "o" or c == "p" or c == "q" or c == "r" c == "s" or c == "t" or c == "u" or c == "v" or c == "w" or c == "x" or c == "y" or c == "z" then


Expected 'endif" @:
JASS:
else


Expected 'endif" @:
JASS:
endif



+rep if you can help me solve this problem...
 

Kuberr24

Well-Known Member
Reaction score
28
For some reason, my world editor only allows 1 line of script to have a certain length. I don't know if this is only me, but I *think* you exceeded the amount of text allowed in 1 script line.

Try shortening it, just to test? Does it also give compile errors if you change it to only check for a b and c instead of the whole alphabet?
 

LoveTD's

New Member
Reaction score
34
lol I forgot 1 or statement in that extremely long line XD

thanks for helping anyways +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top