I thought I would try to benchmark some DBPro commands to MSCorlib.DLL, but I'm having trouble getting the syntax right...
http://msdn.microsoft.com/en-us/library/system.math.sqrt.aspx
#Constant Const_MScorlib 1
Load Dll "C:\Windows\Microsoft.NET\Framework\v2.0.50727\MScorlib.dll",Const_MScorlib
Do
If Dll Exist (Const_MScorlib)
`Print "SQRT of 4 is: " ; sqrt(4)
Print "SQRT of 4 is: " ; MSsqrt(4)
Else
Print "Check your path to MScorlib.DLL"
Endif
Loop
End
Function MSsqrt(Val_A As DWORD)
Func_Return as Float
Func_Return = Call Dll(Const_MScorlib, "Math.Sqrt",Val_A )
Endfunction Func_Return
What am I forgetting here? I'm sure I'm close!
ALSO, for extra bonus points, what's the difference between Standard DBPro DLL functions in comparison to Matrix1 Utilities DLL commands? They look like they do the same thing, but I assume that the Matrix1 commands add more functionality. Unfortunately I can't get the Matrix1 DLL calls to work, so would appreciate any help on this too.
EDIT: For some lols, here's me at maximum retard. Babylonian's, eat your heart out.
Do
Time = Hitimer()
For Test_1 = 1 To 100000
Testing = Func_sqrt_1(Number)
Next Test_1
Print Func_sqrt_1(Number)
Print Hitimer() - Time
Print ""
Time = Hitimer()
For Test_2 = 1 To 100000
Testing = Sqrt(Number)
Next Test_2
Print Sqrt(Number)
Print Hitimer() - Time
wait key
Loop
End
Function Func_sqrt_1(Val_A As DWORD)
Val_Half = Ceil(Val_A * 0.33)
For Next_Number = Val_Half To 0 Step -1
If Next_Number * Next_Number = Val_A
Func_Return = Next_Number
Exitfunction Func_Return
Endif
Next Next_Number
Endfunction Func_Return