Xref: utzoo comp.windows.ms.programmer:3285 alt.religion.computers:2557 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ysub!psuvm!f0o Organization: Penn State University Date: Monday, 24 Jun 1991 15:17:47 EDT From: Message-ID: <91175.151747F0O@psuvm.psu.edu> Newsgroups: comp.windows.ms.programmer,alt.religion.computers Subject: RE: ap, Windows Basic F0O@psuvm.psu.edu writes: > In article <4k4q47w164w@mantis.co.uk>, mathew@mantis.co.uk (Giving C News a > *HUG*) says: > > This segment will match strings that are exactly equal to "everything" > the current value of AnotherString, or that fall between "nuts" and "soup" > in alphabetical order > > SELECT CASE AStringVariable > CASE "everything", "nuts" TO "soup", AnotherString > ... > END SELECT >>That's just >> IF AStringVariable = "everything" OR AStringVariable = AnotherString OR >> (AStringVariable > "nuts" AND AStringVariable < "soup") >> ... >> ELSE >> ... >> ENDIF >> >>In other words, the SELECT CASE you mention is just syntactic sugar for >>IF...ELSE...ENDIF. >> >>If you happen to prefer the CASE syntax, in C++ you could write yourself a >>quick macro. And if you want to do lots of comparisons like the one you >>mention, you could write yourself a quick macro in C++, or a function in >>Modula-2 or Pascal. True, it is window dressing. But this window dressing takes up less lines(which would be appreciated if you're doing ALOT of comparisons and it looks cleaner(in my opinion). [..] > >> It is a fully structured language except for the > >> fact you can't have nested blocks as in Pascal. > >That's like saying it's fully object-oriented except it doesn't have > >inheritance... > > Could be, except I don't use nested blocks very often, so I don't miss > it too much. >>Precisely! Because you don't have the feature, you've never used it. So you >>don't know how useful and important it is. And then when you move up to a >>better language, you're trapped in the BASIC mindset. Wrong. I program alot in Turbo Pascal, in which I have used the nested block feature. Just that for the programs I write here at work, I usually don't need that feature. Just want to say in closing that no language is perfect. All have their strengths and failings; which can differ from person to person. Basic is fine for some things, C is great for others. Pick the language best suited for the task. [Tim]