HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

No pointers?

12-23-2002, 07:36 PM#1
BahamutZERO
Does JASS uses pointers or not? Let me explain. I have a function that modifies a string.

Can I do something like (in WorldEdit)

Code:
call MyFunction( "Some String", udg_STRING_SomeWEVariable)

And have MyFunction do something like

Code:
function MyFunction takes string str1, string str2 returns nothing
    str2 = (str2 + ( ";" + str1 ) )
endfunction

MyFunction would be in Blizzard.j or something.

If that is not possible, anyone has a suggestion to go around that limitation?

Thanks.
12-23-2002, 09:02 PM#2
Guest
I don't think your function would work, because I don't believe parameters are passed by reference in JASS. I could be wrong on this, but that's how I understand it.

If, on the other hand, you did this:

Code:
function MyFunction takes string str1, string str2 returns string
    
    local string finalstr

    finalstr = (str2 + ( ";" + str1 ) )
   
    return finalstr

endfunction

That SHOULD work.
12-23-2002, 09:05 PM#3
BahamutZERO
Yeah but then that becaomes ugly to use in World Edit.

Thanks though.

And yeah, they are probably passe by value. Shame.

Maybe there is a secret syntax for passing by ref. We'd have to explore that possibility.
12-23-2002, 09:54 PM#4
DKSlayer
I believe that there is some stuff, we don't know about yet. Maybe not tons of stuff, but some things that JASS does that isn't documented/used.
I think when I get a chance one of these times I will sit down and work on some features that most other languages have yet this one doesn't seem to have.
I'll post my findings when I get a chance.
Thanks
DKSlayer