This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.

Difference between revisions of "If"

Jump to navigation Jump to search
102 bytes added ,  03:56, 23 September 2006
imported>JOG
imported>JOG
Line 146: Line 146:
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 156: Line 157:
   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]]
Anonymous user

Navigation menu