User Tools

Site Tools


doswitch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doswitch [2018/03/04 18:36] wolfgangriedmanndoswitch [2018/08/20 04:06] (current) wolfgangriedmann
Line 7: Line 7:
 Please look at this sample code: Please look at this sample code:
  
-<code>method( cLanguage as string ) as string +<code visualfoxpro>method( cLanguage as string ) as string 
 local cResult as string local cResult as string
  
Line 22: Line 22:
 This statement is very efficient and fast, but much less flexible as the ''do case'' statement. This statement is very efficient and fast, but much less flexible as the ''do case'' statement.
 For example, the compiler will give an error in this case: For example, the compiler will give an error in this case:
-<code>case "german"+<code visualfoxpro>case "german"
 .... ....
 case "english" case "english"
Line 28: Line 28:
 case "german"</code> case "german"</code>
 And also this will not work (compiler error also): And also this will not work (compiler error also):
-<code>case cLanguage</code>+<code visualfoxpro>case cLanguage</code>
 because the value need to be a constant and not a variable. because the value need to be a constant and not a variable.
 If you need more than one value, you can write as well: If you need more than one value, you can write as well:
-<code>do switch nValue+<code visualfoxpro>do switch nValue
 case 1 case 1
 case 2 case 2
doswitch.txt · Last modified: 2018/08/20 04:06 by wolfgangriedmann