HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Passively passing a local from func to func?

03-20-2004, 09:01 PM#1
Ghost_81st
How can I pass two locals from one function to another...not using call [func](var).. hopefuly the picture can show what I want. I just want the boolean function to have "Key[array]" and "check_digit"

03-20-2004, 09:45 PM#2
Vexorian
you can just change the if then else to

Code:
if (key[30] == check_digit ) then
    call Display...
else
    ....
endif
03-21-2004, 02:24 AM#3
Ghost_81st
I did that and it worked, then I did one like that for an item check:

Code:
  set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = 6
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( GetItemTypeId( UnitItemInSlotBJ(udg_Hero(), GetForLoopIndexA()) ) == 'I000' ) then
            call RemoveItem( UnitItemInSlotBJ(udg_Hero(), GetForLoopIndexA()) )
        else
            call DoNothing(  )
        endif
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop

this however doesnt work, and I am unsure why it says I am missing a " ' ". anyone got an answer?
03-21-2004, 12:53 PM#4
AIAndy
First, better do not use those global bj_forLoop variables when you are writing a loop in JASS. Rather use a local variable. Also DoNothing() does nothing as the name tells so just leave it out together with the else.
Is udg_Hero a function? Probably not and then you should remove the () there.
03-21-2004, 03:08 PM#5
COOLer
You would be better off using game cache to pass fuction vars its less messy and only slightly slower happy coding!