Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 30th December 2003, 02:48 PM   #1
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Parameters and templates

I have a plugin into which I want to pass 8 floating point values.

I'm currently using:

ac_add_command_full( "cmdname", funcname, 8, "ffffffff", "pdesc", "desc" );

However, I get a complaint that I must use one of the following templates:

templates are: d, f, s, sd, ff, fff, ffffff, dffffffffffffff

I can use "dffffffffffffff" and pass in dummy values, or even concat the values into a string in my TCL and sscanf the floats out in my code, but is there a better/less cludgy way of doing this?

I've tried using NULL for no template (as suggested in the error I got), but this doesn't seem pass the parameters I need correctly.
Dennis is offline   Reply With Quote
Old 30th December 2003, 06:39 PM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Parameters and templates

Hi Dennis,

A new command template was added in AC3D 4.0 - you can use 'argv':

Code:
ac_add_command_full( "cmdname", funcname, 0 , "argv", "pdesc", "desc" );
so your function can be:

Code:
bool funcname(int argc, const char* argv[])
and you handle the parameters yourself.

Andy
Andy is offline   Reply With Quote
Old 30th December 2003, 07:12 PM   #3
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Parameters and templates

Very cool --- thanks Andy!
Dennis is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 07:51 PM.


AC3D Forum
(C) Inivis Limited 2020