Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 927 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
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: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
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 | 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