延迟分配

我正在尝试为类的成员分配一定的值。

sub main()
sub proc1()
C.member1 = Value_temp
temp1=2
end sub
sub proc2()
C.member2= Value_temp
temp2=3
end
.
.
.
sub procN()
C.member3=Value_temp
tempN=7
end sub

Value_temp= Function_getMaxValue(Temp1,Temp2,...TempN)

problem I have is that Value of Value_temp is decided at end of these sub calls based on the highest value of Temp1,Temp2...TempN. Right now as assignment is happening immediately members are taking previous value of Value_temp.

What can I do so that all the class member takes the final value of Value_temp?