View Full Version : () or not
Michael Clease
01-12-2009, 22:59
I was under the impression that a while back that all keywords had been modified to have brackets as an option but this doesnt seem to be the case. or is it this one was missed.
CONTROL SET TEXT will not accept brackets (which I prefer, it looks clearer in my opinion)
Control SET TEXT CBHNDL,%txbthmPath,"InputPath"
to
Control SET TEXT (CBHNDL,%txbthmPath,"InputPath")
Regards
Mike
ErosOlmi
01-12-2009, 23:15
I'm currently working to add double syntax for all UI keywords.
So
Control SET TEXT hndl, ctrlid, text
will be available also as
Control_SetText(hndl, ctrlid, text)
or
Control_SetText hndl, ctrlid, text
Michael Clease
02-12-2009, 00:01
Thanks for info.
I personally don't like the underscore look in code. It looks ok on one line like that in examples, but it gets ugly looking when in full source code. I remember I was bugging Petr in the early days with his tbgl_commandName format. Why the change when Control Set Text worked?
Petr Schreiber
04-12-2009, 15:27
Hi Kent,
I remember that :)
Well, thin of the part before underscore as of NameSpace in OOP.
Maybe in far future, it would be possible to define nameSpace in modules.
TBGL would have TBGL name space, so you could directly use ShowWindow instead of TBGL_ShowWindow. And in case there would be 2 modules with the same command, you could specify the namespace -> TBGL:ShowWindow.
But I am not sure if this is the way, it could lead to some code clarity problems.
Maybe just use : instead of _ could make it look better? No need for a namespace command then, Or Control.SetText
marcuslee
04-12-2009, 20:53
Maybe just use : instead of _ could make it look better? No need for a namespace command then, Or Control.SetText
Control SET TEXT hndl, ctrlid, text
Control_SetText (hndl, ctrlid, text)
Control_SetText hndl, ctrlid, text
Control:SetText (hndl, ctrlid, text)
Control.hndl.ctrlid.SetText = text
'And, many more variations!
That last one I am personally familiar with because that is the basic structure of VBA for Excel, which I have used semi-extensively.
Every programmer will have his likes and dislikes. The true question in my opinion: Is Eros willing to load thinBasic with tons of syntax variations? And, how big would thinBasic become if all our wants were implemented?
Mark :download:
I just mentioned it while Eros was underway with the changes. I just didn't think something_UnderscoreSomething was the nicest code to look at, especially for a BASIC based language and wanted to give some input before all the work was underway.
I think the . notation is nice and it would fit into a future for when and if OOP is incorporated into the language or a spin off is made.
Petr Schreiber
05-12-2009, 01:04
Hi Kent,
the problem is I don't think it is good idea to use faked OOP now (or anywhere where no OOP is), just by naming procedure "TBGL.Vertex" for example.
I think currently it is not possible to create dotted alias for procedure, as it would confuse parser, which would think it is UDT.
For this reason, the "_" is quite straight and correct - no playing on OOP, where it isn't.
But I understand you might not like it.
To the original question - I think that putting () around params is good thing. I am in process of making all TBGL commands accept it.
Petr