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
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 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
Error E1515: Invalid arguments in FunctionName [Solved] #383501
09/21/11 09:25
09/21/11 09:25
Joined: Sep 2011
Posts: 2
The Netherlands
T
TheJjokerR Offline OP
Guest
TheJjokerR  Offline OP
Guest
T

Joined: Sep 2011
Posts: 2
The Netherlands
Hey,

I've been having some problems with a script of mine, here's a relevant bit of the code:
Code:
STRING* arrlanguage[1000];
var i_lang 		= 0;

// A function to set a config value
function SetConfigStr(STRING* cType, STRING* key, STRING* val)
{
	if(str_cmpi (cType, "[language]")){
		str_cpy(arrlanguage[i_lang], key);



And here's how I call it:
Code:
while(file_str_read(fhandle,fileBuffer) != -1)
	{
		var end = str_stri(fileBuffer,"\n");
		var ass = str_stri(fileBuffer,"=");
		fileBuffer = str_cut(NULL,fileBuffer,1,end - 1);
		
		if(str_cmpi (fileBuffer, "[language]") || str_cmpi (fileBuffer, "[graphics]") || str_cmpi (fileBuffer, "[sound]") || str_cmpi (fileBuffer, "[controls]")){
			str_cpy(lastSection, fileBuffer);
		}else{
			STRING* key;
			STRING* val;
			
			key = str_cut(NULL,fileBuffer,1,ass - 1);
			val = str_cut(NULL,fileBuffer,ass + 1,end - 1);
			
			SetConfigStr(lastSection, key, val);
		}
	}



I know for a fact the problem lies in this bit "str_cpy(arrlanguage[i_lang], key);" where the array element is the invalid argument.

I'd expect that if I create the array as a STRING*, each of it's elements will have the same type obviously.

But I keep getting this error:
Error E1515: Invalid arguments in SetConfigStr
for every time it loops through a line from the configuration

Halp.

Last edited by TheJjokerR; 09/21/11 10:59.
Re: Error E1515: Invalid arguments in FunctionName [Re: TheJjokerR] #383504
09/21/11 10:28
09/21/11 10:28
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 987
Budapest
You should initialize the string array before the firrst usage, like this:
Code:
for(i=0;i<1000;i++)
   str_create(arrlanguage[i],"");


Or something like. See the Manual.

Last edited by Aku_Aku; 09/21/11 10:28.
Re: Error E1515: Invalid arguments in FunctionName [Re: Aku_Aku] #383507
09/21/11 10:58
09/21/11 10:58
Joined: Sep 2011
Posts: 2
The Netherlands
T
TheJjokerR Offline OP
Guest
TheJjokerR  Offline OP
Guest
T

Joined: Sep 2011
Posts: 2
The Netherlands
Originally Posted By: Aku_Aku
You should initialize the string array before the firrst usage, like this:
Code:
for(i=0;i<1000;i++)
   str_create(arrlanguage[i],"");


Or something like. See the Manual.


That's odd, OK, thanks anyways it works now.

This is how I did it:
Code:
var i;
for(i=0;i<1000;i++){
   arrlanguage[i] = str_create("");
}




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