Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
3 registered members (Martin_HH, steyr, alibaba), 509 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
functions #229497
09/28/08 00:38
09/28/08 00:38
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
hello,
Can some one tell me why this function is not working.
This is very simple code.
Code:

#include <acknex.h>;   //You need these includes at the start of your main script.
#include <default.c>;


//////////////////////////////declared function/////////////////////////////////////////////////////////////
function one();


function main()
{
 //This section happens once when the function is run initially
 level_load("");
 wait(3);  //Wait required for level load
} 
 
 
 ////////////////////////////////calling the function//////////////////////////////////////////////////////
 while(1)
 { 
  //This section happens every frame due to a while loop.
       
     
    
    one();

  

}                                
 
     wait(1);


/////////// function////////////////////////////////////////////////////////////////////////////////
 function one()
 {
 	
  
 	
 	{sys_exit("bye bye...");} 
 	
 	
 	
 	
}






Thank you
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Re: functions [Re: sadsack] #229533
09/28/08 12:50
09/28/08 12:50
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
Member

Joined: Aug 2008
Posts: 218
U.S.
Code:

#include <acknex.h>;   //You need these includes at the start of your main script.
#include <default.c>;


//////////////////////////////declared function/////////////////////////////////////////////////////////////
function one();


function main()
{
 //This section happens once when the function is run initially
 level_load("");
 wait(3);  //Wait required for level load
one();                              	
}

/////////// function////////////////////////////////////////////////////////////////////////////////
 function one()
 {
 	
 	sys_exit("bye bye...");
 	 
 	
 	
 	
}



You don't need a while loop unless you intend on calling it more than one time and in this case you can't.


"You may never know what results come of your action, but if you do nothing there will be no result."
-Mahatma Gandhi
Re: functions [Re: GamerX] #229548
09/28/08 14:58
09/28/08 14:58
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Why does this function does not work in the while loop. I plan on having more than one function.
Thank You
renny


I have A7 Commercial .............. Now I just need to learn how to use it

Re: functions [Re: sadsack] #229551
09/28/08 15:15
09/28/08 15:15
Joined: Aug 2008
Posts: 218
U.S.
GamerX Offline
Member
GamerX  Offline
Member

Joined: Aug 2008
Posts: 218
U.S.
You can put it in a while loop if you want just make sure the loop is in a function like in this case in the main function

Code:

#include <acknex.h>;  
#include <default.c>;


//////////////////////////////declared function/////////////////////////////////////////////////////////////
function one();


function main()
{
 //This section happens once when the function is run initially
 level_load("");
 wait(3);  //Wait required for level load
 
 while(1)
 { 
  //This section happens every frame due to a while loop.
       
     
    
    one();

      wait(1);

}                                
 
 }


/////////// function////////////////////////////////////////////////////////////////////////////////
 function one()
 {
 	
  
 	
 	sys_exit("bye bye...");
 	
 	
 	
 	
}


See? Need it in a function or its just sitting there doing nothing.


"You may never know what results come of your action, but if you do nothing there will be no result."
-Mahatma Gandhi
Re: functions [Re: GamerX] #229565
09/28/08 16:56
09/28/08 16:56
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline OP
Senior Member
sadsack  Offline OP
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
Thank you GamerX I could not think why that would not work, But thanks to you I see how importance {} are now.
Thanks renny


I have A7 Commercial .............. Now I just need to learn how to use it


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