[THIN] OT: Computer Language Phrasebook Website [Plug & a request for he lp]

  • From: Spriggs Jon <Jon.Spriggs@xxxxxxxxxxxxxx>
  • To: windows2000@xxxxxxxxxxxxx, thin@xxxxxxxxxxxxx
  • Date: Mon, 25 Oct 2004 10:00:35 +0100

Hi all,

I wonder if anyone can assist me with a project I'm working on. Basically,
I'm a programmer who uses a couple of different programming languages, and I
always get lost with the semantics of the different dialects. In order to
make it a bit easier, I've started a website called the "Computer Language
Phrasebook" at http://language.hollosite.com <http://language.hollosite.com>
which, I'm hoping will be a series of short statements like the following
(from
http://language.hollosite.com/modules.php?name=News&file=article&sid=3&mode=
&order=0&thold=0
<http://language.hollosite.com/modules.php?name=News&file=article&sid=3&mode
=&order=0&thold=0> ):

Case Statements are a simple and easy way to check what one variable is
doing. It's certainly a lot quicker than doing lots of If, ElseIf, Else and
End Ifs. Here's a quick rundown on how to use them in PHP and VB Script.


In PHP you have a distinct advantage over VBScripters, in that there's also
a default value that you can select. You can also group together a set of
case statements.

Switch ($varname) {
Case "Option1":
echo "Option1";
break;
Case "Option2":
Case "Option3":
echo "Options 2 or 3";
break;
Case "Option4":
echo "Option 4";
Case "Option5":
echo "And option 5";
break;
Default:
echo "All other options";
}

-- Windows Scripting Host --

Select Case strVariable
Case "Value 1"
wscript.echo "Value 1"
Case "Value 2"
wscript.echo "Value 2"
End Select

And, hopefully, people will then add comments to this article with things
like "In perl you do it as follows:" or "It's wrong - WSH can have a default
value" (in which case, I'll learn things as well :) )

So... if you've got time to lend a hand, I'd be grateful. I'm adding stuff
in on the fly as I think of it, so if you've got anything to add, then this
site will become a great resource. Likewise, if you know any sites that do
something like this already, let me know and I'll talk to them about sharing
content.

Cheers,

Jon Spriggs
-- 
The presence of a "Fujitsu" address does not imply or assume that Fujitsu
Services, Fujitsu or any other company containing the Fujitsu name uses or
endorses this product. This email is purely a personal opinion.

Other related posts:

  • » [THIN] OT: Computer Language Phrasebook Website [Plug & a request for he lp]