Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 9,798 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
confusing semantics #244497
01/05/09 04:54
01/05/09 04:54
Joined: Dec 2008
Posts: 43
D
DavidM Offline OP
Newbie
DavidM  Offline OP
Newbie
D

Joined: Dec 2008
Posts: 43
function testme(char *cnt )
{
STRING TESTING;
str_cpy( &TESTING, cnt );
}

function main()
{
testme( "HELLO" );
}

Can someone tell me why the script crashes at the str_cpy.

-David

Re: confusing semantics [Re: DavidM] #244498
01/05/09 05:13
01/05/09 05:13
Joined: Jan 2006
Posts: 53
New Jersey, USA
J
jimc74 Offline
Junior Member
jimc74  Offline
Junior Member
J

Joined: Jan 2006
Posts: 53
New Jersey, USA
You can look at the commands in help.
I believe that if you are using Lite-C,
then it should be

STRING* testing
str_cpy(testing, cnt);

also, maybe the STRING* should be outside of the
function.

hope that helps...

-Jimc74

Re: confusing semantics [Re: jimc74] #244503
01/05/09 07:11
01/05/09 07:11
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
STRING is an engine object, you can create it by STRRING* mystring="#20"; (and using str_create)

you can write what your string to be instead of #20, if write #sometring, it'll be # amoun t of spaces.

you dont need to take care of the lenght of the string, while you are using str_cpy, and str_cat, it handled by the engine.

Generally(%99.9) engine s own functions are made in way that you dont need to use an "&" and struggle with pointer logic.(unless you want to something else, and...)


3333333333

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