This page covers arrays from any datatype tips & tricks.
(From CenturaPro september 1999)
To pass arrays using messages, use this nice trick to convert the address of any type of array
to a number and send them along as wParam or lParam.
At the source (sending side) do this to pass arrays to a window
! Construct an array with weekdays Set saWeekDay = "Monday" Set saWeekDay = "Tuesday" Set saWeekDay = "Wednesday" ! ! Construct an array with customer objects Set uaCustomer.sivCustomerName = "Brendan Perry" Set uaCustomer.nivCustomerID = 1 Set uaCustomer.sivCustomerName = "Lisa Gerrard" Set uaCustomer.nivCustomerID = 2 ! ! Get the address of the arrays as number Set nAddressStringArray = SalWindowHandleToNumber( saWeekDay ) Set nAddressUDVArray = SalWindowHandleToNumber( uaCustomer ) ! ! Send along the addresses as wParam and lParam Call SalPostMsg( frmMain, SAM_User, nAddressStringArray, nAddressUDVArray )
Now at the receiving side (frmMain), convert the array address back to an array variable
On SAM_User Call VisArrayCopy( SalNumberToWindowHandle( wParam ), saWeekDay, DT_String ) Call VisArrayCopy( SalNumberToWindowHandle( lParam ), uaCustomer, DT_Handle )