OPTION BYVAL


Specifies parameters are to be passed by value by default in procedure declarations

Syntax:
Option Byval

Description:
Option Byval is a statement that sets the default passing convention for procedure parameters to by value, as if declared with Byval. This default remains in effect for the rest of the module in which Option Byval is used, and can be overridden by specifying Byref in parameter lists.

Examples:
'' compile with the "-lang fblite" compiler switch

#lang "fblite"

Sub TestDefaultByref( a As Integer )
  '' change the value
  a = a * 2
End Sub

Option ByVal

Sub TestDefaultByval( a As Integer )
  a = a * 2
End Sub

Dim a As Integer = 1

Print "a = "; a
TestDefaultByref( a )
Print "After TestDefaultByref : a = "; a
Print

Print "a = "; a
TestDefaultByval( a )
Print "After TestDefaultByval : a = "; a
Print


Dialect Differences:
Differences from QB:
See also:
Back to Compiler Switches
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode