new is me(alway =0)

Just starting out? Need help? Post your questions and find answers here.
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

new is me(alway =0)

Post 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?
DominiqueB
Enthusiast
Enthusiast
Posts: 103
Joined: Fri Apr 25, 2003 4:00 pm
Location: France

Hu

Post 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.
Dominique

Windows 10 64bits. Pure basic 32bits
sec
Enthusiast
Enthusiast
Posts: 792
Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:

Post by sec »

oh, thanks
i have problem with my pointer (PokeF,)
Post Reply