[futurebasic] Alternate method for fill by reference

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2013 : Group Archive : Group : All Groups

From: "Edwards, Waverly" <Waverly.Edwards@...>
Date: Wed, 1 May 2013 05:18:48 -0500
Is there another method or syntax that I would use to fill by reference.
I was hoping I could find something a little closer to TestFillByReference, where fileType.nil& = _"WAVE" but without using the ".nil&" notation.
I am really running away from TestFillByReference2 because it is so verbose.

Am I overlooking a lighter weight syntax to accomplish what I want?

Thanks,


W.


local mode
local fn TestFillByReference( fileType as ptr to UInt32 )
'~'1
fileType.nil& = _"WAVE"
end fn

local mode
local fn TestFillByReference2( fileType as ptr to UInt32 )
'~'1
dim as UInt32 useType
useType = _"WAVE"
blockmove @useType, fileType, sizeof(UInt32)
end fn

dim as UInt32 fileType

fileType = 0
print fileType, mki$(fileType)
fn TestFillByReference( @fileType )
print fileType, mki$(fileType)

// reset
fileType = 0
print fileType, mki$(fileType)
fn TestFillByReference2( @fileType )
print fileType, mki$(fileType)

do
handleevents
until gFBQuit