Restored from previous forum. Originally posted by julianbury.
Scrub it
Sorry, forget it
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Sebi.
Hello julianbury,
I havn't explained it enough.
The parameters and the result must be Strings!
Your Sin-Function should look like this:
Then you can call the function with "mSin(number)"...
Sebi
Hello julianbury,
I havn't explained it enough.
The parameters and the result must be Strings!
Your Sin-Function should look like this:
Code: Select all
Global Result.s
Procedure mSin(n.s)
Result=StrF( Sin( ValF( n ) ) )
ProcedureReturn @Result
EndProcedure
SetFunc_("mSin",1,@mSin())Sebi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Sebi.
Hello julianbury,
it don't work because you don't use the same procedures you added.
You add the procedure "mASin" to the parser but you call "ASin".
The name of the procedure you add must be the same as the name when you call the function.
When you use this Add_parser_functions()-procedure it works:
Everything else in your code is right.
Sebi
Hello julianbury,
it don't work because you don't use the same procedures you added.
You add the procedure "mASin" to the parser but you call "ASin".
The name of the procedure you add must be the same as the name when you call the function.
When you use this Add_parser_functions()-procedure it works:
Code: Select all
Procedure Add_parser_functions() SetFunc_("Sin" ,1,@mSin())
SetFunc_("ASin" ,1,@mASin())
SetFunc_("Cos" ,1,@mCos())
SetFunc_("ACos" ,1,@mACos())
SetFunc_("Tan" ,1,@mTan())
SetFunc_("ATan" ,1,@mATan())
SetFunc_("Log" ,1,@mLog())
SetFunc_("Log10",1,@mLog10())
SetFunc_("Sqr" ,1,@mSqr())
SetFunc_("Abs" ,1,@mAbs())
SetFunc_("Int" ,1,@mInt())
EndProcedureSebi
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm