|
Post by EmilHalim on Apr 8, 2016 14:14:32 GMT -5
Hi Tom.
trying to implement the following in my PlugIn
const char* strF(const char * frmt, float val)
{
static char mystr[255]={0};
sprintf(mystr,frmt,val);
return mystr;
} void DLLFUNC Func_StrF(IDLL_Basic4GL_Runtime &basic4gl) //(int FadeID)
{
const char* st = strF(basic4gl.GetStringParam(2) ,basic4gl.GetFloatParam(1));
basic4gl.SetStringResult(st);
}
// in load function
registry.RegisterVoidFunction("mpStrf",Func_StrF);
registry.AddParam(DLL_BASIC4GL_STRING);
registry.AddParam(DLL_BASIC4GL_FLOAT);
but this code has no effect at all
dim f# = 1.01236654 print mpStrF(" val = %4.2f " , f# )
any Help Please.
|
|
|
Post by Tom Mulgrew on Apr 9, 2016 2:08:51 GMT -5
Hi Tom. trying to implement the following in my PlugIn const char* strF(const char * frmt, float val)
{
static char mystr[255]={0};
sprintf(mystr,frmt,val);
return mystr;
} void DLLFUNC Func_StrF(IDLL_Basic4GL_Runtime &basic4gl) //(int FadeID)
{
const char* st = strF(basic4gl.GetStringParam(2) ,basic4gl.GetFloatParam(1));
basic4gl.SetStringResult(st);
}
// in load function
registry.RegisterVoidFunction("mpStrf",Func_StrF);
registry.AddParam(DLL_BASIC4GL_STRING);
registry.AddParam(DLL_BASIC4GL_FLOAT);
but this code has no effect at all dim f# = 1.01236654 print mpStrF(" val = %4.2f " , f# ) any Help Please. Hi, Instead of registry.RegisterVoidFunction("mpStrf",Func_StrF); Try registry.RegisterFunction("mpStrf", Func_StrF, DLL_BASIC4GL_STRING);
|
|
|
Post by EmilHalim on Apr 9, 2016 11:01:52 GMT -5
thanks Tom.
|
|