Editing If

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 274: Line 274:
When using Tabs or Spaces to separate operators/expressions you need to use the same separator on each side. If you use Space on one side and Tab on the other, the script might be permanently stopped when the line is executed.
When using Tabs or Spaces to separate operators/expressions you need to use the same separator on each side. If you use Space on one side and Tab on the other, the script might be permanently stopped when the line is executed.


   if SomeVar>=1           ;GOOD
   if SomeVar>=1         ;GOOD
   if (SomeVar>=1)         ;GOOD
   if (SomeVar>=1)       ;GOOD
   if ( SomeVar >= 1 )     ;GOOD
   if ( SomeVar >= 1 )   ;GOOD
   if (SomeVar___>=___1)   ;GOOD ( "___" = Tab)  
   if (SomeVar___>=___1) ;GOOD ( "___" = Tab)  
   if___(SomeVar >= 1)     ;GOOD ( Tab before "'''('''" and ''nothing'' after it is okay)
   if___(SomeVar >= 1)   ;GOOD ( Tab before "'''('''" and ''nothing'' after it is okay)  
  if ( SomeVar ___>=___1) ;GOOD ( Spaces around "'''SomeVar'''"), tabs around "'''>='''")  


   if ( SomeVar___>=___1);BAD  ( Space and Tab around "'''SomeVar'''" causes problems)
   if ( SomeVar___>=___1);BAD  ( Space and Tab around "'''SomeVar'''" causes problems)
Line 285: Line 284:
   if (___SomeVar >= 1)  ;BAD  ( Space and Tab around "'''('''")   
   if (___SomeVar >= 1)  ;BAD  ( Space and Tab around "'''('''")   
   if___( SomeVar >= 1)  ;BAD  ( Tab and Space around "'''('''")  
   if___( SomeVar >= 1)  ;BAD  ( Tab and Space around "'''('''")  
   if SomeVar >=___1    ;BAD  ( Space and Tab around "'''>='''")   
   if SomeVar >=___1    ;BAD  ( Space and Tab around "'''=>'''")   
   if (SomeVar___>= 1)  ;BAD  ( Tab and Space around "'''>='''")   
   if (SomeVar___>= 1)  ;BAD  ( Tab and Space around "'''=>'''")   


Note that you will not receive any compiler error or warnings. You only notice the script not working correctly. You can determine if the problem is caused by this by examining the script in an external text-editor or by looking directly at the compiled script data.  
Note that you will not receive any compiler error or warnings. You only notice the script not working correctly. You can determine if the problem is caused by this by examining the script in an external text-editor or by looking directly at the compiled script data.  


[[Category:Commands]]
[[Category:Commands]]

Please note that all contributions to the Oblivion ConstructionSet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see CSwiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)