User Tools

Site Tools


assign_no_returnvalue

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
assign_no_returnvalue [2018/06/07 07:13] wolfgangriedmannassign_no_returnvalue [2018/06/09 10:48] (current) wolfgangriedmann
Line 2: Line 2:
  
 VO unfortunately permits to return a value from an ''assign''. Since this is not permitted in .NET, the X# compiler will return an error of VO unfortunately permits to return a value from an ''assign''. Since this is not permitted in .NET, the X# compiler will return an error of
- +<code>Warning XS9032 This entity type cannot return a value. Return value ignored.</code>
-[code][/code] +
-[code] Warning XS9032 This entity type cannot return a value. Return value ignored. [/code] +
- +
-[code]Warning XS9032 This entity type cannot return a value. Return value ignored.[/code]+
  
 The following code, perfectly valid in VO, will throw this warning in X#: The following code, perfectly valid in VO, will throw this warning in X#:
-[code]class MyClass+<code visualfoxpro>class MyClass
   protect _cMyVar as string   protect _cMyVar as string
      
Line 15: Line 11:
   _cMyVar := cMyVar   _cMyVar := cMyVar
      
-  return _cMyVar[/code]+  return _cMyVar</code>
      
 It is recommended to type the access/assign pairs in VO, like this sample: It is recommended to type the access/assign pairs in VO, like this sample:
-[code]class MyClass+<code visualfoxpro>class MyClass
   protect _cMyVar as string   protect _cMyVar as string
      
   declare assign MyVar     declare assign MyVar  
- 
      
 assign MyVar( cMyVar as string ) as void pascal class MyClass assign MyVar( cMyVar as string ) as void pascal class MyClass
   _cMyVar := cMyVar   _cMyVar := cMyVar
      
-  return _cMyVar[/code]+  return</code>
 In this manner the compiler will you notify when you anywhere in your code have used the return value of the ''assign'' statement. (other than giving you faster and more stable code) In this manner the compiler will you notify when you anywhere in your code have used the return value of the ''assign'' statement. (other than giving you faster and more stable code)
  
assign_no_returnvalue.1528355606.txt.gz · Last modified: 2018/06/07 07:13 by wolfgangriedmann