Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,244 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
STRING* arrays #178712
01/19/08 11:51
01/19/08 11:51
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline OP
Senior Expert
Quad  Offline OP
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
i want to declare a string array to use with half-life console-like thingy.

STRING* console_strs[20] = {"#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60","#60"};

didnt work.

any ideas?


3333333333
Re: STRING* arrays [Re: Quad] #178713
01/20/08 00:16
01/20/08 00:16
Joined: Dec 2006
Posts: 78
Nevada, USA
Futurulus Offline
Junior Member
Futurulus  Offline
Junior Member

Joined: Dec 2006
Posts: 78
Nevada, USA
You could make a loop in a startup function that fills your array.
Code:
STRING* console_strs[20];
function fillstrs_startup()
{
var s;
for(s = 0; s < 20; s++)
console_strs[s] = str_create("#60");
}

You wouldn't be able to use console_strs in other startup functions, though.

How, exactly, didn't it work? Did you get an error, or did the strings show up empty somewhere in the script?

Re: STRING* arrays [Re: Futurulus] #178714
01/21/08 23:21
01/21/08 23:21
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline OP
Senior Expert
Quad  Offline OP
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quote:

You could make a loop in a startup function that fills your array.
Code:
STRING* console_strs[20];
function fillstrs_startup()
{
var s;
for(s = 0; s < 20; s++)
console_strs[s] = str_create("#60");
}

You wouldn't be able to use console_strs in other startup functions, though.

How, exactly, didn't it work? Did you get an error, or did the strings show up empty somewhere in the script?




Actually i use only one STRING* for console strings and appending it after actions but thank you for your reply.

I dont remember exactly but it was like a syntax error or something. I mean it doesnt even start, it throws an error.


3333333333

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