Thread: Subs parameters
View Single Post
  #6 (permalink)  
Old 01-21-2010, 06:08 AM
merli merli is offline
Junior Member
 
Join Date: Sep 2009
Posts: 18
Default

Quote:
Originally Posted by derez View Post
Your wish can be answered in two options :
1. to define min and max as global, then they are changed by the sub and you can refer to their value outside of the sub (and they should not be in the arguments list).
2. to return one variable which is a string : min & "," & max, and then use an array of 2 to split it
Code:
Dim mix(2)

sub min_max(a,b)
...
...
return min & "," & max
end sub

mix() = strsplit(min_max(a,b) , 
",")
min = mix(0)
max = mix(1)
Nice workaround, but you still have to have arrays global declared. Erel, is it planned to have posibility declare arrays localy?
Reply With Quote