I have just recently looked through Verge and am trying to learn it to help out with some projects.
One thing I see sorely lacking that would help almost every demo I've seen *SO* much is the inclusion of Java-like or C++-like switch or case statements.
So instead of having ridiculous if-blocks, for example:
So much cleaner. If there is already Verge functionality similar to this that I am not aware of, please someone let know. Also can someone tell me how to tab text on this message board, so my pseudocode above is actually readable? Thanks for reading!
No need to worry, switch statements are in, and work very much like they do in c/c++. As far as I know the only difference is that there is no "break;" or default case in verge's switches.
Posted on 2004-05-06 18:57:07 (last edited on 2004-05-06 18:58:32)
switch (amount) {
case a: b;
case c: d;
case e: f;
}
Is what you want. There are no breaks or default like Rysen said, so you can't have any "designed bleed-thru" action, and it only works for the specified cases.
Switch/case statments are used quite a bit in the "Timeless" demo available in the Verge 3 files section under demos. That was one of the first available demos, and made by vecna no less. :D
switch (variable) {
case 0: Print( "Your variable is zero!" );
case 1: Print( "Your variable is one!" );
}
You can only check one and one variable at a time, no greater-than or less-than comparing. Unless Verge3 completely changed the way switch cases works.
(Though, they did change the way it work by not having break; Oh well.)
PS: No code tag? I tried <code> and <vc>, both were removed.
Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.