Hi guys,
I have one mad idea, which could solve 2 problems at the same time:
* problem #1, some errors at run time occur, because functions have wrong number of parameters, but currently thinBasic engine has no chance to detect it
* problem #2, where to take description for code tips?
The possible solution -> adding one more (optional) parameter to the thinBasic_LoadSymbol function, which would be string, specifying some kind of mask for the parameters function can use.
Simple example:
The last parameter as a whole can directly serve as help for code tips.thinBasic_LoadSymbol "TBGL_Vertex", _
%thinBasic_ReturnNone, _
CODEPTR( Exec_TBGL_Vertex ), _
%thinBasic_ForceOverWrite, _
"(x,y,z)"
For checking, you can easily recognize the parameters should start with (, then 2 commas, then ).
In case of optional parameters, they would be indicated like in help file:
This can again be used both by code tips and for syntax check at the time before parsing.thinBasic_LoadSymbol "SomeFunction", _
%thinBasic_ReturnNone, _
CODEPTR( Exec_SomeFunction ), _
%thinBasic_ForceOverWrite, _
"(x,y[,z])"
This is just idea for future, I don't need it currently, but wanted to let you know about it, and possibly discuss the problems of this solution.
Regarding the parameter description, instead of just "x" in above example, some special characters could be added to add more info for use with code tips:
or to not bloat module, just command TB to seek for more info in help files automatically:thinBasic_LoadSymbol "SomeFunction", _
%thinBasic_ReturnNone, _
CODEPTR( Exec_SomeFunction ), _
%thinBasic_ForceOverWrite, _
"(x?X coordinate,y?Y coordinate[,z?Z coordinate])"
thinBasic_LoadSymbol "SomeFunction", _
%thinBasic_ReturnNone, _
CODEPTR( Exec_SomeFunction ), _
%thinBasic_ForceOverWrite, _
"(x,y[,z])@HELPFILE:thinbasic_tbgl.chm@"
Petr
Bookmarks