Gamestudio Links
Zorro Links
Newest Posts
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, Quad, TipmyPip, 1 invisible), 5,861 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
STRING* parameter #427594
08/10/13 11:07
08/10/13 11:07
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Hey guys!
Ive got a big problem here frown
So Im using this code (pseuode function):
Code:
function writeString(STRING *strParam)
{
	wait(-1);
	strParam = str_create("test");
}

...

STRING *szRet;
writeString(szRet);
while(szRet == NULL) wait(1);
printf("%s", _chr(szRet));



But the while wont ever break!
I need this for receiving special infos from a sql database...

Re: STRING* parameter [Re: Ch40zzC0d3r] #427595
08/10/13 12:28
08/10/13 12:28
Joined: Sep 2009
Posts: 1,032
Budapest
Aku_Aku Offline
Serious User
Aku_Aku  Offline
Serious User

Joined: Sep 2009
Posts: 1,032
Budapest
Try this.
Instead of strParam = str_create("test"); use strParam = str_create("");
And insert this line:
str_cpy(strParam,"test");

Re: STRING* parameter [Re: Aku_Aku] #427597
08/10/13 12:40
08/10/13 12:40
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Nope, sorry doesnt work.
I think the parameter pointer gets fucked up anyhow...
If I printf("%X, &strParam) the address before and after the wait is different frown

Last edited by Ch40zzC0d3r; 08/10/13 12:40.
Re: STRING* parameter [Re: Ch40zzC0d3r] #427601
08/10/13 13:46
08/10/13 13:46
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Code:
function writeString(STRING *strParam)
{
	wait(-1);
	str_cpy(strParam, "hey this works!");
}

...

STRING *szRet = str_create("#256");
str_cpy(szRet, ""); //Set to length 0
writeString(szRet);
while(str_len(szRet) == 0) wait(1);
error(szRet);



Visit my site: www.masterq32.de
Re: STRING* parameter [Re: MasterQ32] #427610
08/10/13 16:11
08/10/13 16:11
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline OP
Serious User
Ch40zzC0d3r  Offline OP
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Thanks youre the best wink
Works perfectly!


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