Possibility to autoconvert String

Posted By: TripleX

Possibility to autoconvert String - 12/05/07 13:04

Hey,

There are still 3 big workflow slowdowns when converting from c-lite / wdl to dll (btw, if needed i could write a tutorial about this.. pretty trained in this topic now )

1) Is there any possibility to convert str_cpy(str,str2); automatically to str_cpy(str,(char*)str2);?
2) DLLFUNC long test() { return 1; } is of course 0.001 in C-Script. Is it possible to autoconvert returns to long (var as return type isn't possible because of c-binding of DLLFUNC)
3) var_array[var_value]; will give out a compiler-error. var_array[(int)var_value]; is needed. Any work around for this problem?

Thanks for any help,
Timo Stark
Posted By: jcl

Re: Possibility to autoconvert String - 12/06/07 06:51

I'm not sure if I'm answering this correctly as I don't know the particular problem to solve, but here are some suggestions. For avoiding the (char*) typecast, use an overloaded function like

inline STRING* str_cpy(STRING* str, STRING* str2)
{
return str_cpy(str,(char*)str2);
}

For avoiding the C binding, you can use __declspec(dllexport) instead of DLLFUNC. For using var for an index in an array, overload the [] operator.
© 2024 lite-C Forums