Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (AndrewAMD, TipmyPip), 12,672 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
External variable in the function parameter #431966
10/27/13 14:41
10/27/13 14:41
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Code:
var vTemp = 0;
void getValue(var value)
{	
	value = 10;	
}

...

getValue(vTemp);



...

How can I modify the global variable specified in a function parameter?


Last edited by NeoNeper; 10/27/13 14:42.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: External variable in the function parameter [Re: NeoNeper] #431969
10/27/13 16:16
10/27/13 16:16
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
lol use pointers^^
Code:
var vTemp = 0;
void getValue(var *value)
{	
	*value = 10;	
}

...

getValue(&vTemp);


Re: External variable in the function parameter (SOLVED) [Re: Ch40zzC0d3r] #431975
10/27/13 17:41
10/27/13 17:41
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
I had already tried, but I was not having success too!
Code:
*value = 10; // I did not know I could declare this way



Tankx man (^.^)!


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: External variable in the function parameter (SOLVED) [Re: NeoNeper] #431977
10/27/13 17:45
10/27/13 17:45
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
That's not a declaration. It's an indirection and an assignment.


Always learn from history, to be sure you make the same mistakes again...
Re: External variable in the function parameter (SOLVED) [Re: Uhrwerk] #431992
10/28/13 00:46
10/28/13 00:46
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Oyaa. SOry (^.^)


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1