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 / WHILE ... WEND

Author
Message
Otrebor
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 28th Sep 2003 18:24
QBASIC program:

WHILE (a < = b)
rem loop
WEND
rem continue


I try to use WHILE...ENDWHILE in DB, but don´t work !
Any help ?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Sep 2003 18:56
Try:



If your mansion house needs haunting, just call Rentaghost!
Otrebor
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 28th Sep 2003 20:01
spooky,

Don´t work...but i found a mode:

a=1
b=10
REPEAT
PRINT a
INC a
UNTIL (a < = b)
PRINT " end loop "
WAIT KEY

The "UNTIL" command has the same result.
Anyway thank´s !
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Sep 2003 20:06
How does it not work for you? I get a list of numbers from 1 to 10:



c:/dos
c:/dos run
run dos run
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 28th Sep 2003 20:14
UNTIL is not the same as WHILE

WHILE will leave as soon as it hits the criteria.
UNTIL will hit the criteria, then do it one more time.

It's all down to the point where it leaves the loop.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 28th Sep 2003 20:41
I still don't understand why code dont work for you. Can you please tell me what DB you are running (DB Classic or DB Pro) and what patch you are running.

What error does it give you?

If your mansion house needs haunting, just call Rentaghost!
OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Sep 2003 23:27
Remember that a WHILE statement can be executed 0 (ie it doesn't do anything in the WHILE/ENDWHILE section) or more times, whilst REPEAT/UNTIL must be executed at least once.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
Otrebor
20
Years of Service
User Offline
Joined: 27th Sep 2003
Location:
Posted: 29th Sep 2003 00:05
Ooops...sorry, my fault !
When tried i put the symbol " < " separate of " = ".
Work´s fine.

Thank´s again !!

Login to post a reply

Server time is: 2024-09-21 01:13:47
Your offset time is: 2024-09-21 01:13:47