Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, VoroneTZ), 1,507 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | chip programmers | 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