forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


SELECT CASE command in VDS6?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 179
Location: Netherlands

PostPosted: Sun Jan 30, 2005 10:20 pm    Post subject: SELECT CASE command in VDS6? Reply with quote

Jules,

Will VDS6 also contain a command like:

SELECT CASE %D
CASE 1
do something
CASE 2
do something else
CASE 3
..........
OTHERWISE
..........
END

This would sure be an asset to produce more tidy coding than a number of nested IFs.

Jan
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Mon Jan 31, 2005 12:21 am    Post subject: Reply with quote

Jan,
This has been discussed before. I really doubt that Jules will add a Select Case since there is already a If ElsIf Else End which basicly does the same exact thing as a Select Case and IMHO is just as readable.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Jan 31, 2005 12:29 am    Post subject: Reply with quote

I think dragonsphere's prolly right - and a SWITCH/CASE
(or whatever) would prolly require another type of "END"
(similiar to "WHILE" using "WEND").

Otherwise the whole IF/ELSE/ELSIF/END routines would
prolly have to be re-written. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 179
Location: Netherlands

PostPosted: Mon Jan 31, 2005 1:08 am    Post subject: Reply with quote

No other commands have to be rewritten, it's just a new command added to the VDS syntax.
I know I can do the same with the IF command, just think a SWITCH/CASE construction is more readable.
I've lived without it in VDS until now and I'll survive if it's not added but I still think coding would be more readable if you have a several levels deep IF command and could use a SWITCH/CASE instead.
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Jan 31, 2005 1:21 am    Post subject: Reply with quote

Ya do realize that ELSIFs aren't nested any more
than CASE statements would be?

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 179
Location: Netherlands

PostPosted: Mon Jan 31, 2005 2:04 am    Post subject: Reply with quote

Looking again in the VDS helpfile you are right Embarassed

I'm so used to

IF ...
...
ELSE
...
END

that I thought the ELSIF needed as may ENDs (and indentings) as it had IFs but looking at

IF ...
...
ELSIF ...
...
ELSIF ...
...
ELSE
...
END

it sure looks a lot like the SWITCH/CASE I had in mind.

Well at least it made for some nice conversation Laughing

I'm off to bed (it's after 3 at night over here)

See ya tomorrow!
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Jan 31, 2005 8:07 am    Post subject: Reply with quote

from memory, didn't someone put together a dll or a dsu with the SELECT CASE thingy in it?

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Jan 31, 2005 9:03 am    Post subject: Reply with quote

SELECT CASE %D = GOTO %D isn't it?

I think the only change that would be required to provide this full functionality is to provide the option to specify another label to use if %D doesn't exist, which at the moment you need to use OPTION ERRORTRAP to handle.

GOTO <label>, <label_if_not_exist>

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Jan 31, 2005 6:32 pm    Post subject: Reply with quote

Yes, I made a DSU for that. You can find it here here:

http://www.vdsworld.com/forum/viewtopic.php?p=15320#15320

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group