Author Topic: The way if statements are displayed  (Read 6131 times)

Corvack

  • Guest
The way if statements are displayed
« on: May 14, 2016, 02:16:41 AM »
Hello everyone!

im using VA for a couple of weeks now and it really is amazing.
The only thing i cant get my head around is the way if statements are displayed.
as a web developer im used to the following:

Code: [Select]
if(CONDITION){
   do something
}
elseif(CONDITION) {
   do something
}
else {
   do something
}

but in voice attack it looks more like:
Code: [Select]
if(CONDITION){
   do something
else
   if(CONDITION) {
      do something
   else
      if(CONDITION) {
         do something
      }
   }
}

the reason i find this harder to read is that it seems to go deeper and deeper,
eventho it isn't, because it should check the first condition, if it isnt met, it should check the second one.

maybe it isnt such big deal with the above example, but if you have 'if statements within if statements', its gonna look very messy.

is there a specific reason its done this way?
and what are your opinions ?
« Last Edit: May 14, 2016, 02:52:32 AM by Corvack »

Tenebrous

  • Newbie
  • *
  • Posts: 10
Re: The way if statements are displayed
« Reply #1 on: May 14, 2016, 04:59:31 AM »
There are actual single-line Else If statements available in VA - try those!

Corvack

  • Guest
Re: The way if statements are displayed
« Reply #2 on: May 14, 2016, 06:53:57 AM »
im running beta right now and indeed, i found them!
so thank you!

i dont think theyre added in the stable build is it?