Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 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