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.

DarkBASIC Discussion / Select case between 1 and 99 eg

Author
Message
Gizmo
22
Years of Service
User Offline
Joined: 6th Nov 2002
Location:
Posted: 4th Aug 2004 06:19
I'm trying to use the select statement and i need to know when a variable is between 1 and 50 say then 51 and 99 etc etc using a case statement.

doesn't work,

any other ideas other than using nested if statements

Gizmo
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Aug 2004 08:19
I think you are using VB syntax, and DB unfortunately isn't as flexible. It would probably be quicker to code with nested IF statements.

BatVink
http://biglaugh.co.uk/catalog AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 4th Aug 2004 15:34
if var1>=1 and var1<=50 then blah
if var1>=51 and var1<=99 then blah

That's the only way I can imagine doing it. Sorry about the ifs.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Gizmo
22
Years of Service
User Offline
Joined: 6th Nov 2002
Location:
Posted: 4th Aug 2004 21:47
Hold my hands up, yep, I'm transfering some code over from VB I wrote some years ago for an RPG character creation routine.

Looks like the nested IF is the way to go in DB.

Thanks all.

There's no place like 127.0.0.1

Login to post a reply

Server time is: 2025-05-25 19:52:20
Your offset time is: 2025-05-25 19:52:20