F64 Library Question

Just starting out? Need help? Post your questions and find answers here.
CaddMan
User
User
Posts: 21
Joined: Sat Jul 10, 2004 8:05 pm
Location: USA (East Coast)

F64 Library Question

Post by CaddMan »

Hello,

I am a bit disappointed that PureBasic does not support double type variables at this time, since most of the CAD APIs I am working with need this functionality to work correctly. I am trying to use the F64 add on library. Using the following code below. How would I correctly assign float values to the doubles StartLine \x \y and EndLine x\ \y ?


Structure Point2D
x.double
y.double
EndStructure

Dim StartLine.Point2D(1)
Dim EndLine.Point2D(1)


StartLine(0) \x
StartLine(0) \y

EndLine(0) \x
Endline(0) \y

Thank You
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

examples:

Code: Select all

Structure Point2D 
  x.double 
  y.double 
EndStructure 

Dim StartLine.Point2D(1) 
Dim EndLine.Point2D(1) 


F64_Val(StartLine(0)\x,"3.1415926535897932384626433832795") 
F64_Val(StartLine(0)\y,"2.7182818284590452353602874713527") 
OpenConsole()
PrintN(F64_Str(StartLine(0)\x, 15,#F64_Format_Scientific))
PrintN(F64_Str(StartLine(0)\y, 15,#F64_Format_Scientific))

Input()
CloseConsole()
hope this helps :)
CaddMan
User
User
Posts: 21
Joined: Sat Jul 10, 2004 8:05 pm
Location: USA (East Coast)

Post by CaddMan »

Thanks Jack.

That should get me going

Ken
Post Reply