PDA

Click to See Complete Forum and Search --> : returning multiple result trough a function?


CoMMiE
Jan 6th, 2003, 02:56 AM
Hi
Does anyone here knows the best way to return multiple result trough a function?

The two ways i know is to pass the value byref or putting the result of the function in properties, is there any better way to do this?

Thanks

PT Exorcist
Jan 6th, 2003, 03:57 AM
yea

ur function can return a structure or an array

hope it helps

:)

CoMMiE
Jan 6th, 2003, 04:09 AM
Hi thanks for the reply!

But can anyone please show me how to return a structure to the calling object in a class whithout directly exposing the structure


Thanks

StormJason
Jan 7th, 2003, 01:49 AM
Public Structure personal
dim name as string
dim age as integer
end structure

private sub GetPersonal()
dim Mypersonal as new personal

Mypersonal=LoadPersonal()
end sub

private function LoadPersonal() as personal
dim k as new personal

with k
.name="Jason"
.age=23
end with
return k
end function