Page 1 of 1
new is me(alway =0)
Posted: Sat Aug 23, 2003 3:37 am
by sec
Procedure inpt(*vol.f,name.s)
Print("Value "+name$+" =")
tmp.s=Input()
*vol=ValF(tmp)
PrintN("")
EndProcedure
DefType.f a
If OpenConsole()
Inpt(@a,"a")
a=a+1
Print(Str(a))
Input()
CloseConsole()
EndIf
param is address then pass @a to param of procedure inpt(), after valf funciton will change value of a
but when print(str(a)) then a alway =0
where am i wrong?
Hu
Posted: Sat Aug 23, 2003 9:16 am
by DominiqueB
To output a float (that is designed by a .f) just try the Strf() function that is designed to change a .f to a string to be printed...
here is a suggestion for your code:
***************************************************
Procedure inpt(*vol.l, name.s)
Print("Value " + name + " = ")
tmp.s=Input()
PokeF(*vol, ValF(tmp) )
PrintN("")
EndProcedure
a.f = 0.0
If OpenConsole()
inpt(@a,"a")
a = a + 1.0
Print(StrF(a))
Input()
CloseConsole()
EndIf
**************************************************
Dominique.
Posted: Sat Aug 23, 2003 9:52 am
by sec
oh, thanks
i have problem with my pointer (PokeF,)