Page 1 of 1
Posted: Thu Apr 17, 2003 6:56 pm
by BackupUser
Restored from previous forum. Originally posted by julianbury.
Scrub it
Posted: Thu Apr 17, 2003 7:32 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.
shouldn't you use "mSin" and "mAsin" as first parameter to SetFunc_() procedure ?
Posted: Fri Apr 18, 2003 7:55 am
by BackupUser
Restored from previous forum. Originally posted by tinman.
Shouldn't it be:
Procedure.f mSin(n.f)
If you want to be able to return something.
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.51, external editor)
Posted: Fri Apr 18, 2003 2:51 pm
by BackupUser
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:
Code: Select all
Global Result.s
Procedure mSin(n.s)
Result=StrF( Sin( ValF( n ) ) )
ProcedureReturn @Result
EndProcedure
SetFunc_("mSin",1,@mSin())
Then you can call the function with "mSin(number)"...
Sebi
Posted: Fri Apr 18, 2003 3:05 pm
by BackupUser
Restored from previous forum. Originally posted by julianbury.
Ah, I see.
Thank you, Sebi
Julian ^00^
Posted: Fri Apr 18, 2003 4:35 pm
by BackupUser
Restored from previous forum. Originally posted by julianbury.
Scrub it
Posted: Fri Apr 18, 2003 5:20 pm
by BackupUser
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:
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())
EndProcedure
Everything else in your code is right.
Sebi
Posted: Fri Apr 18, 2003 7:22 pm
by BackupUser
Restored from previous forum. Originally posted by julianbury.
Hi Sebi
Users will not like that.
Must think some more ...
Aaaaah! My brain, it's too small!
Oooo, the thoughts are too BIG!
Julian ^00^