Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
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
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
WDL code #3170
05/01/01 22:48
05/01/01 22:48

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



Ok, Im mostly a "Hands On" kind of programmer, I prefer step by step instructions on how to do something, which is why i've resorted to the forums, rather than the WDL manual on this one...
Im having trouble with variables.
Heres what i got.

Var test;

function do_this1
{
(do something here)
Var test = 1;
}

funtion do_this2
{
(do something else)
Var test = 0;
}

Action DOTHIS
{
MY.ENABLE_CLICK = ON;
If (test == 0)
{
MY.EVENT = do_this1;
}
If (test == 1)
{
MY.EVENT = do_this2;
}
}

What I want is to be able to click on something once and something happens...
Then when I click on it the second time for it to do something else, then reset the action so next time you click on it, it will do the first thing and so on....
I can get my first function do_this1 to work properly, but i dont think it sets the variable to =1 correctly, cause the second time i click on it, it does nothing. Both functions work properly as i've been playing around with the "If (do_this1 == 0)" changing it to a 1 and that works.

I could use a few tips on how to make a variable equale a specific number.



Re: WDL code #3171
05/01/01 23:36
05/01/01 23:36

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



one way to do this is simply turn off the first button and turn on a second and attach your new function to it.

Re: WDL code #3172
05/02/01 05:29
05/02/01 05:29
Joined: Jul 2000
Posts: 2,037
Lafayette, LA USA
J
James Snydstrup Offline
Senior Expert
James Snydstrup  Offline
Senior Expert
J

Joined: Jul 2000
Posts: 2,037
Lafayette, LA USA
Shovei51:

Here is an easier way to toggle the 'test' variable.

test = ABS (test - 1);

This will toggle test between 0 and 1.


Re: WDL code #3173
05/02/01 08:07
05/02/01 08:07

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



hehe you are right , that much easier

Re: WDL code #3174
05/02/01 17:00
05/02/01 17:00

A
Anonymous OP
Unregistered
Anonymous OP
Unregistered
A



thanx for the tips guys,
I'll try that.

Re: WDL code #3175
05/02/01 21:51
05/02/01 21:51
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
W
WildCat Offline
Expert
WildCat  Offline
Expert
W

Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
James,

That was an elegant one-liner! To think all this time I'd been doing it the hard way...

-WildCat



Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!

Moderated by  HeelX, Spirit 

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