Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Sven Barth via fpc-pascal
Am 06.07.2017 23:34 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-07-06 20:07, Dmitry Boyarintsev wrote: >> >> The thread of discussion: >> http://lists.freepascal.org/pipermail/fpc-devel/2016-February/036709.html > > > > Thanks for the link. Seems this topic has

Re: [fpc-pascal] If vs case or something else?

2017-07-06 Thread Stefan V. Pantazi
I am not sure I follow. If switching on strings, or any sparse value set, you can use the balanced tree approach or better yet, a hash table. But when switching on a compact, limited set of integer values (as the case seems to be), I do not see how you can compete with constant time procedure

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Michael Van Canneyt
On Thu, 6 Jul 2017, Sven Barth via fpc-pascal wrote: On 06.07.2017 16:13, Graeme Geldenhuys wrote: Imagine if FPC had type inference and multi-line strings, neither very exotic features. The code then becomes: = var query := '''SELECT

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Graeme Geldenhuys
On 2017-07-06 20:07, Dmitry Boyarintsev wrote: The thread of discussion: http://lists.freepascal.org/pipermail/fpc-devel/2016-February/036709.html Thanks for the link. Seems this topic has already been discussed a year and a bit ago. Anybody know if there was any movement on the

Re: [fpc-pascal] If vs case or something else?

2017-07-06 Thread Ched
Hi Stefan, You can skip large blocks of tests coding like this If Length(txt)>0 then case txt[1] of 'a': if txt='another' then ... else if txt='anum' then ...; 'b': if txt="bubble' then ... else if ... else

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Mark Morgan Lloyd
On 06/07/17 20:00, Sven Barth via fpc-pascal wrote: On 06.07.2017 16:13, Graeme Geldenhuys wrote:> Imagine if FPC had type inference and multi-line strings, neither very> exotic features. The code then becomes:> > => var query := '''SELECT

Re: [fpc-pascal] If vs case or something else?

2017-07-06 Thread Stefan V. Pantazi
That is quite the case statement you have there. You may benefit greatly from re-analyzing and refactoring your programs by splitting them in multiple individual units, if possible. That should be perfectly possible if Dosomething(); DoSomethingelse(); keep repeating across your 70+ switch

Re: [fpc-pascal] If vs case or something else?

2017-07-06 Thread Sven Barth via fpc-pascal
On 06.07.2017 18:33, James Richters wrote: > I can use case statement with strings apparently now, but the thing is, I > create this file myself in an earlier stage, so I do not need to create the > file with strings at all, I could use some codes and do something like this: "case of String"

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Sven Barth via fpc-pascal
On 06.07.2017 16:13, Graeme Geldenhuys wrote: > Imagine if FPC had type inference and multi-line strings, neither very > exotic features. The code then becomes: > > = > var query := '''SELECT Customers.CustomerName, Orders.OrderID > FROM Customers > FULL

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Dmitry Boyarintsev
On Thu, Jul 6, 2017 at 10:27 AM, Marcos Douglas B. Santos wrote: > That would be very, very nice. > And instead of using [ " ' sql ' " ] would be better to use just [ " sql " > ]. > The thread of discussion:

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Bernd Oppolzer
Am 06.07.2017 um 18:32 schrieb Andreas: For this reason I would be against this implementation. Maybe taking away the need for the + sign at the end of the line. The strings are concatenated until a semi-colon or other symbol is encountered This is what the (new) Stanford Pascal compiler

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > > Imagine if FPC had type inference and multi-line strings, neither very > exotic features. The code then becomes: > > = > var query := '''SELECT Customers.CustomerName, Orders.OrderID > FROM Customers >

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Karoly Balogh (Charlie/SGR)
Hi, On Thu, 6 Jul 2017, Graeme Geldenhuys wrote: > On 2017-07-06 15:35, Karoly Balogh (Charlie/SGR) wrote: > > But sure, web devs are well known for their productivity... :P > > Just in case you thought I was a web developer - far from it! > > Anyway, the idea was just that - an idea (and

[fpc-pascal] If vs case or something else?

2017-07-06 Thread James Richters
I'm trying to optimize a console application ported over from Turbo Pascal with a huge set of if then else statements like this: Var TXT : String; If TXT = 'Thing1' then Begin Dosomething(); DoSomethingelse(); End else If TXT = 'AnotherThing' then Begin

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Andreas
Graeme, I am a big fan of your messages. You have many good ideas and I sometimes read a theme that I am not interested in just to see your response. In this case however I think you are wrong. Pascal has fantastic inherent type and error checking in its structure. It would be wrong to have

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Graeme Geldenhuys
On 2017-07-06 15:35, Karoly Balogh (Charlie/SGR) wrote: But sure, web devs are well known for their productivity... :P Just in case you thought I was a web developer - far from it! Anyway, the idea was just that - an idea (and possibly an improvement) on an age old problem. I have no means

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Karoly Balogh (Charlie/SGR)
Hi, On Thu, 6 Jul 2017, Graeme Geldenhuys wrote: > Imagine if FPC had type inference and multi-line strings, neither very > exotic features. The code then becomes: > > = > var query := '''SELECT Customers.CustomerName, Orders.OrderID > FROM Customers >

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Marcos Douglas B. Santos
On Thu, Jul 6, 2017 at 11:13 AM, Graeme Geldenhuys wrote: > > Imagine if FPC had type inference and multi-line strings, neither very exotic > features. The code then becomes: > > = > var query := '''SELECT

[fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Graeme Geldenhuys
Ever had a problem like this? You have some SQL, say: SELECT Customers.CustomerName, Orders.OrderID FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID ORDER BY Customers.CustomerName; and you want to add that SQL to the SQL property of a query at runtime. You

Re: [fpc-pascal] Serial to TCP gateway in FPC?

2017-07-06 Thread Michael Schnell
On 04.07.2017 00:06, Mark Morgan Lloyd wrote: ... if you're in any sort of tight loop you need to call APM to get any of the usual GUI stuff to work. Including any messages sent by worker threads such as "TThread.Queue", "TThread.Synchronize", "Application.QueueAsnycCall" and