Calling Procedures With Structure Arguments
Posted: Fri Mar 07, 2003 2:46 am
Code updated for 5.20+
Restored from previous forum. Originally posted by Inner.
Restored from previous forum. Originally posted by Inner.
Code: Select all
#MAX_VALUE=3
Structure TESTSTRUCT
name.s
number.l
array_string.s[#MAX_VALUE]
array_long.l[#MAX_VALUE]
array_word.w[#MAX_VALUE]
array_byte.b[#MAX_VALUE]
EndStructure
mystruct.TESTSTRUCT
mystruct\name="Test String"
mystruct\number=3665412
For i=0 To #MAX_VALUE-1 : mystruct\array_string[i]="String Array "+Str(i) : Next
For i=0 To #MAX_VALUE-1 : mystruct\array_long[i]=Random(100) : Next
For i=0 To #MAX_VALUE-1 : mystruct\array_word[i]=Random(100) : Next
For i=0 To #MAX_VALUE-1 : mystruct\array_byte[i]=Random(100) : Next
Procedure Display_TESTSTRUCT(*outstruct.TESTSTRUCT)
Debug(*outstruct\name)
Debug(*outstruct\number)
For i=0 To #MAX_VALUE-1 : Debug(*outstruct\array_string[i]) : Next
For i=0 To #MAX_VALUE-1 : Debug(".L Array "+Str(*outstruct\array_long[i])) : Next
For i=0 To #MAX_VALUE-1 : Debug(".W Array "+Str(*outstruct\array_word[i])) : Next
For i=0 To #MAX_VALUE-1 : Debug(".B Array "+Str(*outstruct\array_byte[i])) : Next
EndProcedure
Display_TESTSTRUCT(@mystruct)