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

Option Byval

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.

'' 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 "a = "; a
TestDefaultByval( a )
Print "After TestDefaultByval : a = "; a

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

sf.net phatcode