PDA

View Full Version : UDT_VarPtr.tbasic



DirectuX
22-12-2018, 20:38
Hi, .

successful running of UDT_VarPtr.tbasic requires to add parenthesis around the wStarsSection function's parameter.


If these parenthesis are mandatory :

there is that sample script to correct (I can post the corrected file, though there are only 6 parenthesis to add.)
It is not obvious in thinbasic's help that parenthesis are mandatory or not (from my point of view)

If parenthesis are not mandatory, (I think it is not, because for others function calls it works ok) then thinbasic misinterpret a call without parenthesis to a function for which parameters are optional.
In both case, behaviour is not consistent.


Note:not sure if this thread goes here or in thinbasic core's forum

Petr Schreiber
24-12-2018, 13:13
Thanks for reporting it!


Petr

DirectuX
03-01-2019, 12:59
Hi Petr,

don't mention it,

yet, could you please tell the intended behaviour ?

Petr Schreiber
03-01-2019, 20:44
We will think with Eros how to address documentation update.

Fact is thinBasic design is not consistent across the modules, regarding the use of brackets.

This is partially caused by the freedom programmer has when creating thinBasic module. There are separate thinBasic_CheckOpenParens_Mandatory, thinBasic_CheckOpenParens_Optional, thinBasic_CheckCloseParens_Mandatory, thinBasic_CheckCloseParens_Optional, which allow to design function requiring, allowing or preventing the use of brackets.

The action point for this would be to correct the example and be clear in help file.

I will notify Eros about this, so he can address it in the next release.


Petr

ErosOlmi
03-01-2019, 22:41
Dear Sebastian,

thanks for reporting the problem. It is a bug!
Adding parenthesis just bypass the problem but in reality it is a bug in reading functions parameters when ALL parameters of a function are optional like in wStartSection function.
I wrote UDT_VarPtr.tbasic in 2011 and after that time optional parameters parsing changed so many times.

I will fix in next update.

Petr reply regarding freedom to develop thinBasic internal functions in Core engine and external modules is true. One can decide () are optional or decide the other way round.
This freedom can be a problem and a feature at the same time.

Thanks again.
Eros

DirectuX
04-01-2019, 09:06
Hi,

Eros, you're welcome.:)

I reported more things in the support part of the website (https://www.thinbasic.com/community/project.php) (though the correct version cannot be selected)

ErosOlmi
04-01-2019, 09:09
Yes, thanks.
I will go through them all in next days.

Just relaxing after a high load period at work.