Dark Age Games
Home Dark Age EX Dark Age 2 Message Board Fan Art FAQ Kelzar Mage DALpedia MS Forum
Board Index Dark Age General Bug Report Website Off Topic Register User Edit User User List Search

In reply to: Third reply! -- Colin 03:16:23 11-03-2004

"switch" construct
Posted by: Colin
03:23:11 11-03-2004

This is one you should have used:

  if(avatarID == 0){ var avpath = "avatars/blank.gif"; } else
  if(avatarID == 1){ var avpath = "avatars/brash.gif"; } else


Becomes...

switch (avatarID)
{

case 0:
{
var avpath = "avatars/blank.gif";
} break; // Or something to that effect (whatever JS uses :P)

case 1:
{
var avpath = "avatars/brash.gif";
} break;

}


It's also if (, while (, for (, note the space.

Sorry for the 10 million posts - I'll never choose vie source again :P

Edit Post