|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
[appleeaters]multiple moves and globals
im trying to make a short function to take in an array and do all the moves in it.
it always starts and shows all the game info butnever shows any moves btw: the $game and $robots are globals in mine but i dont see why it might be a problem |
|
#2
|
|||
|
|||
|
[appleeaters]RE: multiple moves and globals
|
|
#3
|
|||
|
|||
|
[appleeaters]RE: multiple moves and globals
Thanks it worked
but i was wondering I did define them as globals at the top of the script btw: i did try to do: global $game=$robots->start(); but it always returned: "Parse error: parse error, unexpected '=', expecting ',' or ';' in c:inetpubwwwrootrobot.php on line 6" well anyways it didn't seem to work until i did what you said and defined it as global inside the function also. I was wondering why it wouldnt work w/o it? Thanks a lot :-D |
|
#4
|
|||
|
|||
|
[appleeaters]RE: multiple moves and globals
Variables inside the function are treated as local unless explicitly mentioned as global.
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > [appleeaters]multiple moves and globals |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|