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
Key nur einmal aufrufen #249874
02/04/09 18:22
02/04/09 18:22
Joined: Oct 2005
Posts: 612
Inari Offline OP
User
Inari  Offline OP
User

Joined: Oct 2005
Posts: 612
Ich habe folgenes Problem, wenn ich eine Taste drücke wird
die darin erhaltene Funktion x mal aufgerufen.

wie schreibe ich es am besten das die Funktion nur
einmal aufgerufen wird und erst wenn ich die Taste los lasse und diese wieder drücke erneut ausgeführt wird?

Inari

Re: Key nur einmal aufrufen [Re: Inari] #249890
02/04/09 18:59
02/04/09 18:59
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
on_KEY = function;

Bsp:
on_a = help_inari;

this should call the function only once when the key was pressed.
note: this button declarations/defines have to happen in a function when you use lite-C. example: put them in main

Re: Key nur einmal aufrufen [Re: Xarthor] #249905
02/04/09 19:49
02/04/09 19:49
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline
Senior Member
Ralph  Offline
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Es geht auch außerhalb der Main, unzwar so:
Code:
if(key_x==1){
   while(key_x==1){wait(1);}
   // jetzt mache ich was ^^
}


MFG Ralph

Re: Key nur einmal aufrufen [Re: Ralph] #250255
02/06/09 21:52
02/06/09 21:52
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl

ore for inside a loop

Code:

var key_a_r;

while(1)
{
if(key_a_r && key_a)
{
key_a_r = 0;
//do_somthing;
}
if(!key_a)
{
key_a_r = 1;
}

//loop isnt disturbed;
c_move(...
wait(1);
}




"empty"

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