Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 827 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
str_cpy not work #471787
03/19/18 20:25
03/19/18 20:25
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
hello,
i hate my 3dgs problems but must rely ask you, on my win8.1 (3dgs is installed in c:GStudio8)
why code not work for me?
Code:
#include <acknex.h>
#include <default.c>
#include <strio.c>;
STRING* srt100;
function main()
{
	level_load(NULL);
	str_cpy(srt100,"a"); // string has now empty content
}



iger Error E1515
(X) Invalid function arguments in main

P.S. i have make changes in atypes. but I have install 3dgs new and the first time, the installer told me to restart windows

Re: str_cpy not work [Re: CocaCola] #471789
03/19/18 20:50
03/19/18 20:50
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
when we write
Code:
STRING *str100;


we are declaring an empty STRING pointer.

Code:
STRING *str100 = "";


Declares a STRING pointer that points to a newly created empty STRING struct. But only in global STRING pointers. For local pointers you must create it with str_create and remove it at the end.

Code:
STRING *strLocal = str_create("");
...
str_remove(strLocal);
strLocal = NULL;



Salud!

Last edited by txesmi; 03/19/18 20:51.
Re: str_cpy not work [Re: txesmi] #471791
03/19/18 20:58
03/19/18 20:58
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
yea, super thank you txesmi

have i to write
Code:
strLocal = NULL;

after
Code:
str_remove(strLocal);

?

Re: str_cpy not work [Re: CocaCola] #471794
03/19/18 21:02
03/19/18 21:02
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Not really, but nullifying your empty pointers is a good practice

Re: str_cpy not work [Re: txesmi] #471798
03/19/18 21:27
03/19/18 21:27
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
i will do it so, thats perfekt for my editor programm, its the basic for diferent projekts i will make with 3dgs.
thank you for your help.


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