Hi Mike,
I will study more your sources later because I have to go out right now but just to give you little advices (not related to the problem you are facing).
1.
To zero fill a structure you can use RESET Power Basic keyword instead of using ZeroMemoryAPI API function.
2.
avoid globals when possible. Defining local variables or full structures is really fast in Power Basic even if executed thousands of times per seconds.
So instead to RESET a global structure used by many functions, declare structures locally in the function. Power Basic will RESET them for you every time avoiding the need to call a RESET or a ZeroMemory fill operation.
Of course if you need a global to share info among different functions, it is ok. But if it is only to reuse it, better go local.
3.
thinBasic interface: instead of using
[code=thinbasic]
If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber efID
If thinBasic_CheckCloseParens() Then
...
[/code]
you can do it in one line using:
[code=thinbasic]
efID = thinBasic_Parse1NumberAndParens
[/code]
or with more variables...
[code=thinbasic] If thinBasic_CheckOpenParens() Then
thinBasic_ParseNumber minT
If thinBasic_CheckComma() Then
thinBasic_ParseNumber maxT
If thinBasic_CheckCloseParens() Then
...
[/code]
to
[code=thinbasic] thinBasic_Parse2NumbersAndParens(minT, maxT)
[/code]
There are also other thinBasic_Parse* functions in thinCore.inc up to 6 parameters.
I will check your code again later. I'm not an expert on DI but at least I can see if I find any Power Basic related problem.
Ciao
Eros
Bookmarks