Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Array inside a string #329302
06/19/10 01:52
06/19/10 01:52
Joined: Jun 2010
Posts: 11
N
Nite Offline OP
Newbie
Nite  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 11
i want to use a var array that hold numbers inside a string or inside the TEXT class can anyone help me

Re: Array inside a string [Re: Nite] #329304
06/19/10 02:00
06/19/10 02:00
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
... What?


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Array inside a string [Re: Michael_Schwarz] #329306
06/19/10 02:12
06/19/10 02:12
Joined: Jun 2010
Posts: 11
N
Nite Offline OP
Newbie
Nite  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 11
STRING* YouHit = "You hit the enemy for ";
STRING* TheyHit = "The enemy hit for ";
STRING* Points = " points of damage";
STRING* BattelOutputText1 = ArrayDmgOutput[1];
STRING* BattelOutputText2 = ArrayDmgOutput[2];
STRING* BattelOutputText3 = ArrayDmgOutput[3];
STRING* BattelOutputText4 = ArrayDmgOutput[4];
STRING* BattelOutputText5 = ArrayDmgOutput[5];
STRING* BattelOutputText6 = ArrayDmgOutput[6];

TEXT* BattelOutput1 = //show the dmg for the battel
{
pos_x = 300;
pos_y = 250;
layer = 3;
font = arial_font;
string (YouHit, BattelOutputText1, Points);
}

this doesn't work, what will work

Re: Array inside a string [Re: Nite] #329307
06/19/10 02:14
06/19/10 02:14
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
str_for_num


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Array inside a string [Re: Michael_Schwarz] #329308
06/19/10 02:16
06/19/10 02:16
Joined: Jun 2010
Posts: 11
N
Nite Offline OP
Newbie
Nite  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 11
Originally Posted By: Michael_Schwarz
str_for_num


sorry im still new at this where do i add that

Re: Array inside a string [Re: Nite] #329309
06/19/10 02:19
06/19/10 02:19
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
read the manual


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: Array inside a string [Re: Michael_Schwarz] #329325
06/19/10 03:11
06/19/10 03:11
Joined: Jun 2010
Posts: 11
N
Nite Offline OP
Newbie
Nite  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 11
manual isnt useful

Re: Array inside a string [Re: Nite] #329326
06/19/10 03:17
06/19/10 03:17
Joined: Jun 2010
Posts: 11
N
Nite Offline OP
Newbie
Nite  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 11
where do i put it in a function so it executes or do i put it into the text can i just leave it out in the cold

Re: Array inside a string [Re: Nite] #329327
06/19/10 03:27
06/19/10 03:27
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
I am assuming 'ArrayDmgOutput' is a var array. You're not allowed to simply set a string to a value of a variable. You need to use the 'str_for_num' function...
Code:
str_for_num(BattelOutputText1,ArrayDmgOutput[1]);



Re: Array inside a string [Re: Nite] #329329
06/19/10 03:30
06/19/10 03:30
Joined: Jun 2010
Posts: 11
N
Nite Offline OP
Newbie
Nite  Offline OP
Newbie
N

Joined: Jun 2010
Posts: 11
ok i figured it out you do have to put it into a function witch the manual say nothing about ive been up for 2 day working on this they really need to keep ppl like me in mind and make things easy to fallow when ur half crazy

Last edited by Nite; 06/19/10 03:31.
Page 1 of 2 1 2

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