When a structure is born, set automatic values?
Posted: Tue Feb 17, 2009 10:08 pm
Code: Select all
Structure demostructure
token.s
EndStructure
Procedure.b InitializeDemoStructure(*struc.demostructure)
; this procedure fills the token field in a demostructure with some random letters
; I'm looking for a way to automatically call this procedure whenever an instance of demostructure is first made
*struc\token = ""
For a = 1 To 8
*struc\token+Chr(Random(25)+65)
Next a
EndProcedure
Procedure DoSomething(*ds.demostructure)
; this procedure uses an instance of the demostructure
EndProcedure
test1.demostructure
Debug "test1's token is "+test1\token
DoSomething(@test2.demostructure)
Debug "test2's token is "+test2\token