Coming back into LCB after being away for a while... it's still pretty dismal in LC9dp9:
There is still no switch statement, so I'm ending up with multi-stage, multi-level if/else-if statements that are on the edge of readability. I know it was a conscious decision *not* to have a switch statement, but the logic there is baffling.
I thought by now we'd be able to define constants.
All I get is a syntax error.
I'm trying to convert some code from LCS that would be much better as a widget. Apparently this isn't a good idea.
There's no "exists" function? And no alternative "there is a" function?
There's no "exit handler" function?
I can create rectangles on the canvas and put text in them, but I can't group them?
Debugging is still circa-1980 log statements.
And that's only if you can get past the Syntax Errors at compilation time.
LCB still missing much functionality
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: LCB still missing much functionality
A few words in defense of LCB.
(What could help, for example, with at least 50% of the current "complaints" on the use-list).
If something works good and fast in LCS there is, TMHO, no need and mostly no advantage from "converting" to LCB.
For using canvas operation you can have layers or (sadly currently defunct in linux) grouping by save/restore
For grouping messages you can build your own "cursor rects" and can have full control to which kind of clicks and to which click locations your widget reacts.
And a runtime error is pretty much exact, telling variable type errors and possible "solutions".
It's pretty clear for me that, faster than I did, you too will be one of the strongest defenders/supporters of LCB.
I needed 60 full days (one day each week) to arrive to there.
Yes, I agree here, miss that too. And I miss most strongly the possibility to set the widget's rectangle within its parent, without using LCS.mwieder wrote:There is still no switch statement ...
No, we are able.I thought by now we'd be able to define constants.
Code: Select all
constant <kName> is <value> -- string, number, list, array, boolean, ...
Yes. This is my point of view: LCB/widgets open things you can't have in LCS, say open "new horizons".I'm trying to convert some code from LCS that would be much better as a widget. Apparently this isn't a good idea.
(What could help, for example, with at least 50% of the current "complaints" on the use-list).
If something works good and fast in LCS there is, TMHO, no need and mostly no advantage from "converting" to LCB.
Yes (not for LCS-objects). But when writing 16 widgets I needed that one time.There's no "exists" function? And no alternative "there is a" function?
No, essentially we have. Simply return from the handler.There's no "exit handler" function?
Code: Select all
handler myAnswer(in pNum as Number) returns String
if pNum is not 5 then
return ""
else
--
end if
end handler
What does "grouping" mean here? To which goal?I can create rectangles on the canvas and put text in them, but I can't group them?
For using canvas operation you can have layers or (sadly currently defunct in linux) grouping by save/restore
Code: Select all
begin layer on this canvas
--
end layer on this canvas
save state of this canvas -- saves especially current transform
--
restore state of this canvas -- restores especially saved transform
Syntax errors are always in the indicated line -1.Debugging is still circa-1980 log statements.
And a runtime error is pretty much exact, telling variable type errors and possible "solutions".
You, one of the masters of debugging, are kidding here.And that's only if you can get past the Syntax Errors at compilation time.
It's pretty clear for me that, faster than I did, you too will be one of the strongest defenders/supporters of LCB.
I needed 60 full days (one day each week) to arrive to there.
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: LCB still missing much functionality
Hmmm... I get the dreaded "Syntax Error" forI thought by now we'd be able to define constants.
No, we are able.
constant <kName> is <value> -- string, number, list, array, boolean, ...
Code: Select all
constant kSections is "1,2,4,8,16"
Doh. Of course. Thanks.There's no "exit handler" function?
No, essentially we have. Simply return from the handler.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: LCB still missing much functionality
This works here. Did you already check that your lcb file is UTF-8 encoded?mwieder wrote:Hmmm... I get the dreaded "Syntax Error" forCode: Select all
constant kSections is "1,2,4,8,16"
Or for "gremlins" in pasted code?
shiftLock happens
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: LCB still missing much functionality
Aha! You can't have constants declared inside handlers.
It works if I declare the constant at the root of the script.
Stupid parser.
This is really needing something better than "Syntax Error".
It works if I declare the constant at the root of the script.
Stupid parser.
This is really needing something better than "Syntax Error".
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev