Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable as a reference or value to a function
#13
I will try again:
Code: (Select All)
Dim ALong As Long
Dim BInteger As Integer

BInteger = 1
Print "Binteger is"; BInteger
temp& = passMeALongTypeAndIWillChangeIt&(BInteger)
Print "Binteger after call to Function is"; BInteger; " NOT changed! so effectively passed BInteger by Value"
Print: Print
ALong = 1
Print "Along is"; ALong
temp& = passMeALongTypeAndIWillChangeIt&(ALong)
Print "ALong after call to Function is"; ALong; " changed because ALong is same Type as defined in Function so effectively passed by Reference."

Function passMeALongTypeAndIWillChangeIt& (i As Long)
    i = i * 10
    Print "Inside passMeALongTypeAndIWillChangeIt& i ="; i
    passMeALongTypeAndIWillChangeIt& = whoCares
End Function
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Variable as a reference or value to a function - by bplus - 07-18-2022, 02:29 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Function Pointers? BlameTroi 5 258 02-20-2026, 05:55 PM
Last Post: BlameTroi
  Variable length type declarations dano 5 695 08-06-2025, 09:53 PM
Last Post: dano
  Determining if variable or static string is passed to a Sub dano 9 1,233 06-20-2025, 06:31 PM
Last Post: CookieOscar
  Most efficient way to build a big variable length string? mdijkens 9 1,916 01-17-2025, 11:36 PM
Last Post: ahenry3068
  Huge array of variable length strings mdijkens 9 1,858 10-17-2024, 02:01 PM
Last Post: mdijkens

Forum Jump:


Users browsing this thread: 1 Guest(s)