Typedef and returns
Posted: Sat Dec 27, 2003 1:32 am
It would be nice to have typedef AND be able to return said type. For example I create a structure:
Well that about sums it up, I know this is possible in a manner of speaking using some API calls and such, but I believe for cross platform things which I am aiming for, this would be immensely useful.
Code: Select all
Structure CustomerInfo
ID.l
Name.s
Email.s
EndStructure
TYPEDEF Customer AS CustomerInfo
Procedure.Customer DisplayInfo(Current.Customer)
Debug Current\ID
Debug Current\Name
Debug Current\Email
NewCustomer.Customer
NewCustomer\ID = 25
NewCustomer\Name = "Bob"
NewCustomer\Email = "Bob@Bob.com"
ProcedureReturn NewCustomer
EndProcedure
Customer1.Customer
Customer1\ID = 15
Customer1\Name = "Frank"
Customer1\Email = "Frank@Frank.com"
Customer2.Customer = DisplayInfo(Customer1)