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 / Loops info

Author
Message
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 8th Sep 2005 03:43
Hi i need a good tutorial about Loops

The if command and all the other loops please

Kind regards

You Don't know the power of the Dark Side!!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Torq
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location:
Posted: 8th Sep 2005 06:04
Ok heres a quick one.

This example will print "hi" over and over.


This example will print "HI" 3 times


Note the variable t is just that a variable it can be almost anyname you wish. Just be sure to use the same variable in the next statement like this.

This code does the same thing as the last. But it will print it 10 times.



The for next loop just cycles as many times as you tell it to.
10 20 1000 30000 what ever you need.

This example will print the numbers 1 to 23 then print your name over and over.



http://badtempergames.tripod.com

Torq
20
Years of Service
User Offline
Joined: 18th Jan 2004
Location:
Posted: 8th Sep 2005 06:13
Ok the if statement.

Here we go. The if statement allows you to check a condition. Using signs like.
> greater than
< Less than
= equal to

example.


You could also write the above code like this.


These will only print B is greater than A because its the only true statement. You can also use and,or but you can get to that later. Hope these help.

http://badtempergames.tripod.com

Louiz ofRohr
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 8th Sep 2005 07:02
Quote: "Kind regards "

no problem

If you take a look at the DBP's help files it is gonna be
enough to learn.. but I can help you a little bit..
then you go there and try.. try the commands and search for
examples..




`it means that...
repeat
`these actions:
print counter#
r=r+1
wait 10
...are gonna be executed...
...until the variable called "r" is equal to 100...

until r=100
Each time the program reads the line above it checks if
the condition (r=100) is true.. if it isn't, then it goes
back to "repeat".


The worst foe lies within the self..
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 8th Sep 2005 07:24
Thanks everyone helped alot!!

You Don't know the power of the Dark Side!!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 8th Sep 2005 14:05
BTW - using that link I posted, if you didn't see it, the second of the tutorials for complete beginners covers loops!

TDK_Man

Login to post a reply

Server time is: 2024-11-27 18:30:14
Your offset time is: 2024-11-27 18:30:14