Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AbrahamR), 717 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
making a loading wait #331013
07/01/10 15:33
07/01/10 15:33
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
hello
i tried ti make a function that waits for something and then return, and keep the function going.

function load_wait(int* a){
wait(-2);
*a=2;
}


function main(){
int evl;
load_wait(&evl);
while(evl!=2){wait(1);}
error("ok");
}

the problem is you never see the ok message.

Re: making a loading wait [Re: MMike] #331015
07/01/10 15:41
07/01/10 15:41
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Why not using wait_for()?

wait_for(load_wait);

Re: making a loading wait [Re: Widi] #331016
07/01/10 15:43
07/01/10 15:43
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
where is that? on the manual?

Re: making a loading wait [Re: MMike] #331017
07/01/10 15:47
07/01/10 15:47
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Yeah, search for it, you will get 2 results. wait_for() is a macro and waiting till all instances of this function are finished.

Re: making a loading wait [Re: MMike] #331019
07/01/10 15:49
07/01/10 15:49
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
tryed

wait_for(load_wait(300,300,200));
error("ok");

but the ok appear immediatly which is not true because my real load_wait function is this:

Code:
function load_wait(short a, short b, var time){
PANEL* ar=pan_create("bmap=loading_map;",5);
var timex=0;
fade_pan_in(ar);
pan_set(ar,a,b);
pan_setcenter(ar); //middle rotation point default


while(timex<time){
ar.angle-=2.3;
timex++;
wait(1);}
fade_pan_out(ar); 
ptr_remove(ar);
}



PS: Some commands make part of my own Function library, so it wont work on your side.

Last edited by MMike; 07/01/10 15:52.
Re: making a loading wait [Re: MMike] #331020
07/01/10 15:51
07/01/10 15:51
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
wrong:
wait_for(load_wait(300,300,200));

use:
load_wait(300,300,200);
wait_for(load_wait);


Last edited by Widi; 07/01/10 15:53.
Re: making a loading wait [Re: Widi] #331021
07/01/10 15:53
07/01/10 15:53
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
like this? :
load_wait(300,300,200);
wait_for(load_wait);

next to each right? (since i have to call the load_wait with the right parameters.

Last edited by MMike; 07/01/10 15:53.
Re: making a loading wait [Re: MMike] #331023
07/01/10 15:54
07/01/10 15:54
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
Thanks it worked.

Off-topic, your speak pT?

Last edited by MMike; 07/01/10 15:54.
Re: making a loading wait [Re: MMike] #331024
07/01/10 15:54
07/01/10 15:54
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You was faster then my edit wink


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