Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
nuremical Arrray #320186
04/20/10 09:36
04/20/10 09:36
Joined: Apr 2010
Posts: 47
D
Darkmatters Offline OP
Newbie
Darkmatters  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 47
Is there a way to read nuremical values from an array? I have tried the string function but just seems to be for text. I need to read a series of nuremical values indexed with a counter??

Thanks

F.

Re: nuremical Arrray [Re: Darkmatters] #320187
04/20/10 10:05
04/20/10 10:05
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
I'm not sure, but try it like this:

Code:
// string to fill
STRING* arrayStr[50];

// function that creates empty strings in array
STRING* initString(STRING* inStr, int amount) {
var i;
for(i=0; i<amount; i++) {
inStr[i] = str_create("");
}

retur(inStr);
}

// make SURE you do the following inside a function, not globally :P
// call function to empty all strings before using it!
arrayStr = initString(arrayStr, 50);

// once it's initialised, you can add strings in it however you like;
arrayStr[0] = "Temp text that you can put in it.";



This is totally untested, and might not work at all... but it should give you the idea...

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: nuremical Arrray [Re: Helghast] #320191
04/20/10 10:12
04/20/10 10:12
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
wow... I cant believe what an idiot I am for reading the question wrong tongue
I'll leave the above code for anyone else, but you should be able to store data if it's only numerical values like any other variable...

Code:
// store 50 numbers
var arrayVar[50];

// it's always a good idea to fill the array before using it.
var resetArray(var tempArray, var amount) {
	var i;
	for(i=0; i<amount; i++) {
		tempArray[i] = 0;
	}

	return(tempArray);
}

// again these bottom things should be done WITHIN a function, not global.
// call the function to reset the array
arrayVar = resetArray(arrayVar, 50);

// access them however you want
arrayVar[0] = 2347895;



Also untested, but am more confident that should work wink

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: nuremical Arrray [Re: Helghast] #320244
04/20/10 16:11
04/20/10 16:11
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
when you say read numerical values, do you mean for the PC to read the values, or for the PC to display the values so you can read them?

if you want to do the 1st, have a look at Helghasts post, otherwise have a look at either digits in a panel element, or str_for_num

Re: nuremical Arrray [Re: MrGuest] #320260
04/20/10 16:51
04/20/10 16:51
Joined: Apr 2010
Posts: 47
D
Darkmatters Offline OP
Newbie
Darkmatters  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 47
no its ok, thanks all but sorted it now... simpler than I thought,,, :-)


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