Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
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
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 533 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
can not str_cpy a global string #471982
03/31/18 07:15
03/31/18 07:15
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
hello,
if i make
Quote:

#include <acknex.h>
#include <default.c>
#include <strio.c>;

///////////////////////////////
STRING* global_str="";
function iiiii(){....
str_cpy(global_str," ");

...
}

it not work, it woks onli with local string.
why is it so?

Re: can not str_cpy a global string [Re: CocaCola] #471984
03/31/18 09:53
03/31/18 09:53
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hi

It actually does work, try this:
Code:
#include <acknex.h>
#include <default.c>
#include <strio.c>

STRING* global_str = "";

function main(){
	
	str_cpy(global_str, " ");
	str_cat(global_str, "hello world");
	
	while(!key_esc){
		
		draw_text(global_str, 10, 10, COLOR_WHITE);
		
		wait(1);
		
	}
	
}



Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: can not str_cpy a global string [Re: 3run] #471990
03/31/18 21:33
03/31/18 21:33
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
i dont konow wht was wrong, maby a space " " between file name and .mdl endname.

3run, do you know about a funktion to load files or list all filenames of a workdirektory to a string?

Re: can not str_cpy a global string [Re: CocaCola] #471991
03/31/18 21:37
03/31/18 21:37
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
file_open_read()
file_open_write()
file_open_append()
file_exists()

Look these up in the manual, they should get you started...

Re: can not str_cpy a global string [Re: CocaCola] #471992
03/31/18 21:38
03/31/18 21:38
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
for the test with stings i have make a smal media player for my avi youtube musik files in style of youtube, but i dont know, have i to make a funktion to test all value filenames for the play list or is there a lite-c function?

Re: can not str_cpy a global string [Re: CocaCola] #471994
03/31/18 21:47
03/31/18 21:47
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
can i open more than one file at once?

Re: can not str_cpy a global string [Re: CocaCola] #471995
03/31/18 23:25
03/31/18 23:25
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
My first advice would be to learn to love the manual. Use it all the time, eventually you will understand how to do these things. For playing media files, you need to look up "media_play" and related functions.

I don't use any media files in my games so I can't help you there...

Re: can not str_cpy a global string [Re: Dooley] #472001
04/01/18 08:49
04/01/18 08:49
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
grin that is a sweet statment.

i have no problem with play tha avi files, i can chose the files and it work.

maby i can love the online manual version more wink

Re: can not str_cpy a global string [Re: CocaCola] #472029
04/02/18 19:52
04/02/18 19:52
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
Okay, if you can choose files and play them, then that is a great start.

Like me, you will write a function that does everything you need it to do. THEN you will discover that Lite-c has a built in command that does the same thing laugh

I would recommend posting a new topic, since this is different from your original problem.

Re: can not str_cpy a global string [Re: Dooley] #472073
04/04/18 16:23
04/04/18 16:23
Joined: Mar 2014
Posts: 359
CocaCola Offline OP
Senior Member
CocaCola  Offline OP
Senior Member

Joined: Mar 2014
Posts: 359
It was by me the same with ang_add for my space ship controll. Yes I know what you mean


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