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 Statement in VDS
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
vdsalchemist
Admin Team


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

PostPosted: Tue Oct 21, 2003 2:54 pm    Post subject: Reply with quote

Maybe it is just me but I have already stated this above Rolling Eyes

I have already built a VDS DLL for this. The DLL is Free... I even released the source code to it on the Advanced VDS forum. So you could make it do what ever you wanted. Exclamation Exclamation Exclamation

Tommy is right. There is no need to add a Select Case structure to the language when it already has a If ElsIf structure this is just redundant...

_________________
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
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Tue Oct 21, 2003 3:01 pm    Post subject: Reply with quote

Hi Mindpower
I will take a look Very Happy

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
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: Tue Oct 21, 2003 3:48 pm    Post subject: Reply with quote

mindpower wrote:
Tommy is right. There is no need to add a Select Case structure to the language when it already has a If ElsIf structure this is just redundant...


Yes, but I think a "select/case" structure is easier/smaller than a "if/elsif" structure:

Code:
SELECT %%AA
  CASE 1
    rem Do this
  CASE 2
    rem Do that
  CASE Popcorn
    rem Do something
  ELSE
    rem Whatever
  END


The above code is easier to understand and smaller than this one:

Code:

if @equal(%%AA,1)
  rem Do this
elsif @equal(%%AA,2)
  rem Do that
elsif @equal(%%AA,Popcorn)
  rem Do something
else
  rem Whatever
end


Smile

_________________
[ 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
jules
Professional Member
Professional Member


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

PostPosted: Wed Oct 22, 2003 8:19 am    Post subject: Reply with quote

I don't agree. The "if" version uses one line of code less, and I think it is more understandable in an "english" sense than the "select" version. I remember being very baffled by switch statements when I first looked at C. I think this type of command would be harder to understand for newbies to programming.
_________________
The Tech Pro
www.tech-pro.net
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: Wed Oct 22, 2003 1:25 pm    Post subject: Reply with quote

hi mindpower,

you did mention it but given that this is a wish list, i thought that it would be nice to have such a wish built into vds rather than access it through an external dll...i assume that external dll's take up more memory than if the equivalent feature was built into vds...i am also concerned about having a program loading lots of dll's in order to run as required...may be it is safe to do so but i still prefer using features built vds...hence the wish Smile

i meant nothing more than that and i guess that perhaps i didn't express myself properly

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


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

PostPosted: Wed Oct 22, 2003 3:03 pm    Post subject: Reply with quote

jules wrote:
I don't agree. The "if" version uses one line of code less, and I think it is more understandable in an "english" sense than the "select" version.


Julian, I know the "if" version is shorter in lines, but you need to type more characters ( @equal(%%AA,) ) than the other version, which makes it easier to read. Maybe it is possible to convert the "select-case" commands to the "if" commands when compiling?

_________________
[ 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
vdsalchemist
Admin Team


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

PostPosted: Thu Oct 23, 2003 1:26 am    Post subject: Reply with quote

Hi All,
Well IMHO I think Jules is right. I remember when I first had to learn the Switch Case in C and Select Case in Basic. There is a bit of a learning curve and I kept having to refer to an If Else If block that did the same thing as the Select Case to get the logic right in my head. Even today if I can't get the logic to work with a Select Case I convert it to a If Else If block and then back to a Select Case because in other languages the Select Case is faster especially for nested Select Case's.

Now to answer Serge as far as I know the amount of memory a DLL takes as apposed to using an internal function is dependent on the DLL. My MpSelect.dll's file size is only 7.5kb. When a DLL is initially loaded into memory only a portion of it actually gets loaded the rest acts as a memory mapped file. For most compilers DLL's only use 2kb to map the header of the DLL into memory then as you call functions that function is mapped and loaded on the stack. How much those functions consume will depend on their sizes. Now as far as you being concerned about errors. Yes that is a potential but if all software was perfect then there would not be as much need for us programmers Wink Anyway I do see your point about keeping track of multiple DLL's with your program so here is some suggestions for the group.

1) Find a good simple install program to package your wares and when I say simple I mean simple for you and your users. If you can't find any you like then go on to number 2.
2) Use VDS 5's new improved Resource abilities to wrap as many dependent files as you can into the main Exe. This way when it comes time to upgrade your wares you can just ship out a single Exe and have the user drop it in the directory.
3) Keep a simple text file that has a list of all the files that are supposed to be included with your application and where they should be placed on the users PC. Also you could note the version of the file so that users that have to do audits can easily find all the files associated with your application and you can better manage it as well.

Anyway I guess that is enough from me for now... Happy Select Case's...

_________________
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
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Thu Oct 23, 2003 6:22 pm    Post subject: Reply with quote

jules wrote:
I remember being very baffled by switch statements when I first looked at C. I think this type of command would be harder to understand for newbies to programming.


True, but I think that if the newbies would learn how to use this new command, it would be very usefull, both for newbies and advanced programmers Smile

Vic

_________________
phpBB Development Team
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: Fri Oct 24, 2003 9:45 am    Post subject: Reply with quote

thanks for your lengthy answer mindpower...given the small size of your dll certainly means that i will use it should the need arise (didn't know about the 2k bit...handy to know)

great suggestions with 1 and 3...especially 2...i am still new with vds5 and haven't explored that side of vds 5 and will look forward to using it

thanks again mindpower

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Oct 24, 2003 9:50 am    Post subject: Reply with quote

Yeah mindpower good suggestons. I never had a need to look into those areas since I never had a chance to author anything serious/meant for a end user Laughing
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Wish List All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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