Gamestudio Links
Zorro Links
Newest Posts
How to buy tomorrow at open?
by frutza. 06/01/23 19:58
Adding Position to Current Trade
by AndrewAMD. 05/30/23 10:34
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
Return type of floor()
by AndrewAMD. 05/25/23 14:17
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (AndrewAMD), 1,065 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Call function @temp_00899 error #462068
09/06/16 16:46
09/06/16 16:46
Joined: Sep 2016
Posts: 6
S
SimonHeide Offline OP
Newbie
SimonHeide  Offline OP
Newbie
S

Joined: Sep 2016
Posts: 6
Hi Community,
I'm a lite-c amateur. I started working on my first Programm, to learn vocabularies and made some progress, but now there's this error:"Call function @temp_00899 error"
Could you pls tell me what the meaning of that error is and how to fix it laugh
PS: The problem is in the second for loop at the end and sorry I don t know how to post the code right grin
Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>
//Array für Vokabeln fehlt
int rand;
var hDataHandle = file_open_read("VocabListGer.txt");
var hDataHandle2= file_open_read("VocabListEng.txt");
//nAllVocabs
int nAllVocabs= file_length(hDataHandle) %20;
STRING** strVokabularies;
STRING** strVokabulariesEng[30][2];
STRING* strInput;
int n;
int txtInitialize;
int nStringPanel=0;

TEXT** txtVocabs[30][2];
//Bitmaps
BMAP* bmapFieldOff = "EditFieldOff.bmp";
BMAP* bmapVocabularies = "bmapVocabularies.bmp";
BMAP* bmapOkOff = "OkOff.bmp";
BMAP* bmapOkOn = "OkOn.bmp";
BMAP* bmapCheckOff = "CheckOff.bmp";
BMAP* bmapCheckOn = "CheckOn.bmp";
BMAP* bmapNextOff = "NextOff.bmp";
BMAP* bmapNextOn = "NextOn.bmp";
BMAP* bmapNewOff = "NewOff.bmp";
BMAP* bmapNewOn = "NewOn.bmp";

//Definieren der Funktionsheader
function textInput(); //initialisiert
function check();
function new(); //initialisiert
function next();
function ok(); //initialisiert


for( n=0;n<30;n++){
	rand= random(nAllVocabs-10)*20; 
	if(n<10){
		file_seek(hDataHandle,20*n,2);
		file_seek(hDataHandle2,20*n,2);
		
		file_str_readto(hDataHandle,strVokabularies[n],NULL,20);
		file_str_readto(hDataHandle2,strVokabularies[n],NULL,20);
	}else{
		file_seek(hDataHandle,rand,0);
		file_str_readto(hDataHandle,strVokabularies[n],NULL,25);
	
		file_seek(hDataHandle2,rand,0);
		file_str_readto(hDataHandle2,strVokabulariesEng[n],NULL,25);
	}
}	
file_close(hDataHandle);
file_close(hDataHandle);
STRING* strWord;
STRING* strWord2;
int nLang = random(2);
int nLang2;
for(txtInitialize = 0;txtInitialize <30;txtInitialize++){

	if(nLang ==0){
		strWord= strVokabularies[n];
		strWord2 = strVokabulariesEng[n];
	}else{
		strWord2= strVokabularies[n];
		strWord = strVokabulariesEng[n];
	}	
	txtVocabs[txtInitialize][0]=txt_create(1,2);
	txtVocabs[txtInitialize][1]=txt_create(1,2);
	
	txtVocabs[txtInitialize][0].pos_x = 20;
	txtVocabs[txtInitialize][1].pos_y = 60 + txtInitialize*60;
	set(txtVocabs[txtInitialize][0],SHOW);
	
	
	txtVocabs[txtInitialize][0].pstring(strWord);
	txtVocabs[txtInitialize][1].pstring(strWord2);
	

	
	
}
STRING* strQuestionedWord = txtVocabs[nStringPanel][0].pstring;

TEXT* txtQuestionedWord={
	pos_x = 20;
	pos_y = 0;
	layer=3;
	flags= SHOW;
	string(strQuestionedWord);
	
}	
while(1){
		txtQuestionedWord.pstring(strQuestionedWord);
		wait(1);
	}	
//Damit das aktuelle panel den String bekommt

function ok(){
	if(str_cmpi(strInput, txtVocabs[nStringPanel][1].pstring)==1){
		nStringPanel++;
	}
}



	




function new(){
	var hNewWord = file_open_append("VocabListGer.txt");
	var hNewWord2 = file_open_append("VocabListEng.txt");
	var hNumberOfWords = file_open_write("VocabCounter");
	inkey(txtQuestionedWord.string);
	if (inkey_active ==0){
		inkey(txtInput.string);
	}
	file_seek(hNewWord,0,2);
	file_str_write(hNewWord,txtQuestionedWord.string);
	file_seek(hNewWord2,0,2);
	file_str_write(hNewWord2,txtInput.string);
	//file_close(hNewWord);
	//file_close(hNewWord2);
}



//Die Arrays


TEXT* txtInput={
	pos_x = 200;
	pos_y = 0;
	layer=3;
	flags= SHOW;
	while(1){
		string(strInput);
		wait(1);
	}	
}	

STRING* strSpace =" ";//Hier muss eventuell eine while schleife hinzu
function textInput(){
	var key = inkey(strInput);
	if(key == 13){ 
		process_entry(strInput);
	}
	if(inkey_active == 0){
		while(str_len(strInput)<19){
			str_cat(strInput,	strSpace);
		}
		str_cat(strInput,",");
	}
}	







//Das Panel für die buttons
PANEL* Actions = {
	layer = 4;
	flags = SHOW;
	button_toggle(50,10,bmapCheckOn, bmapCheckOff,NULL,NULL,check, NULL, NULL);
	button_toggle(50,100, bmapNewOn, bmapNewOff, NULL, NULL, new, NULL, NULL);
	button_toggle(50,190, bmapNextOn, bmapNextOff, NULL, NULL, next, NULL, NULL);
	button_toggle(50,280, bmapOkOn, bmapOkOff, NULL, NULL,
ok, NULL, NULL);
}


Last edited by rayp; 09/07/16 10:14. Reason: added code Tags. rayp
Re: Call function @temp_00899 error [Re: SimonHeide] #462071
09/06/16 19:32
09/06/16 19:32
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Seems like you are missing a main function


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Call function @temp_00899 error [Re: WretchedSid] #462082
09/07/16 10:12
09/07/16 10:12
Joined: Jul 2008
Posts: 2,101
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,101
Germany
Davon mal abgesehen programmiert Du außerhalb von functions und Actions wie z.b. an dieser Stelle das kann nicht klappen
z.b.
Quote:
for( n=0;n<30;n++){

edit english: u cant place commands Outside of for example functions.

Added code Tags to your Post btw

Greets

Last edited by rayp; 09/07/16 10:32.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Call function @temp_00899 error [Re: rayp] #462085
09/07/16 17:48
09/07/16 17:48
Joined: Sep 2016
Posts: 6
S
SimonHeide Offline OP
Newbie
SimonHeide  Offline OP
Newbie
S

Joined: Sep 2016
Posts: 6
Danke. Ich hab die beiden Schleifen jetzt als Funktion und diese dann in function main aufgerufen, aber das Problem bleibt bestehen. Oder reicht das nicht?
Viele Grüße Simon

Last edited by SimonHeide; 09/07/16 18:16.

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