Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / execute if statement under certain conditions

Author
Message
Jac
20
Years of Service
User Offline
Joined: 9th Nov 2003
Location:
Posted: 19th Dec 2004 17:55
Having problems getting my head arround if statments

This is a cut down version of what I'm trying to do



I thought the code above should print mouse then the mouse button is pressed and then clear the screen when a key is pressed.

I'm trying this code out for something bigger, not much bigger but still, and would be greatful for any pointers.

Thanks

JC

These are not the droids you are looking for.
flibX0r
21
Years of Service
User Offline
Joined: 14th Feb 2003
Location: Western Australia
Posted: 19th Dec 2004 18:42
well, it would work like you want it to, but its only checking for the mouse click once before the wait key command. Something like this would work better:




Join the Expert Discussion forums dag nammit!
http://www.expertdiscussion.com
Jac
20
Years of Service
User Offline
Joined: 9th Nov 2003
Location:
Posted: 19th Dec 2004 20:23 Edited at: 19th Dec 2004 20:23
Thanks Mr Fibble.

The problem seems to be when I Try to do the same thing twice in one loop where the two if statments kind of interact.

see code below



don't seem to be able to figure what goes wrng in this case?

These are not the droids you are looking for.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 19th Dec 2004 20:46
Hi,

I found a few bugs with your code but I wasn't sure how it was meant to work - so here's something I wrote just now what I think works just as well:



Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Jac
20
Years of Service
User Offline
Joined: 9th Nov 2003
Location:
Posted: 23rd Dec 2004 23:43
So I've been working on the code and still don't fully understand.

I'm trying to create code that will chang the player when the mouse is clicked.

I though the code below rould print to screen 0 then 1 when mouse is clicked and then repeat.



Can anyone explain to me why this isn't happening

Thanks

JC

These are not the droids you are looking for.
Jac
20
Years of Service
User Offline
Joined: 9th Nov 2003
Location:
Posted: 1st Jan 2005 23:11
Thanks Dave T.

Your advice made me look at my understanding of loops and If statments abd I got where I wanted to go.



I now have code that lets me swap players each turn

Thanks again

JC

These are not the droids you are looking for.

Login to post a reply

Server time is: 2024-09-23 08:19:48
Your offset time is: 2024-09-23 08:19:48