[Implemented] Will v4 bring us something like line splitting

Got an idea for enhancing PureBasic? New command(s) you'd like to see?

Do you want multiline splitting/joining support ?

Yes, i agree! Its an important feature and i still miss this...
27
63%
I dont needed this feature yet but it would be nice to have this one...
8
19%
I dont need it (all my sources are using one only long coding line ;-)
8
19%
 
Total votes: 43

va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

[Implemented] Will v4 bring us something like line splitting

Post by va!n »

@fred:
hi fred! hope you are fine and things are going still forwards without spending to mutch time in bug hunting and fixing... ^^

btw, will PureBasic support with v4 or somewhere in the future a feature to split one very long formular in multiply lines and joining them like:

Code: Select all

   result =  ColorR + 1 + ColorG + 2 + ColorB + 3 + ColorA + 4
would be nice if the user can write it somehing like...

Code: Select all

   result = ColorR + 1 +
            ColorG + 2 +
            ColorB + 3 + 
            ColorA + 4   ;      (maybe adding ";" sign where you want end the joining!?)
Maybe it would be possible to use "_" sign at end of a line when wanting join it with the next line... this feature would be very nice (as it would be very usefull for long formulars, like in C/C++) !
Last edited by va!n on Sat Dec 10, 2005 4:07 pm, edited 1 time in total.
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
DarkDragon
Addict
Addict
Posts: 2344
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post by DarkDragon »

(PureBasic = Basic) And (VisualBasic <> Basic).

IIRC Deeem2031 made a precompiler for this
bye,
Daniel
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post by GeoTrail »

What if you want to add a comment after one of those lines :?:
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

For the compiler, split lines would be relatively trivial.

But for the IDE it is a bit more work, given that this is dynamic and etc.

However, it would be really nice, even with VB-ish _ to show line continuation.


PS: Comments just get parsed out.
@}--`--,-- A rose by any other name ..
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

under the new ide this is easy to accomplish, i'll add this option to codecaddy in the next version

it would then do something like:

Code: Select all

a = a+1 + _
      2 + 3 + _
      1
it would upon compilation time replace the above with one line and two empty lines to avoid error reports on the wrong line

Code: Select all

a = a+1 + 2 + 3 + 1


the disadvantage is that it would slow down compilation a little, as i would have to preprocess the source for each and every line
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Might also confuse the IDE re the status bar hint.?

.. But ..

nice to have. ;)
@}--`--,-- A rose by any other name ..
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

blueznl wrote:...

the disadvantage is that it would slow down compilation a little, as i would have to preprocess the source for each and every line
Another disadvatange in such precompiler solutions is in my eyes that it
becomes harder to share code between the different IDE's.

In other words, sources coded with the new IDE / codecaddy cannot be run
with jAPBe for example without modifications :roll:
regards,
benny!
-
pe0ple ar3 str4nge!!!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> In other words, sources coded with the new IDE / codecaddy cannot be run
> with jAPBe for example without modifications

Why not? The compiler is what parses the source, not jaPBe...
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
benny
Enthusiast
Enthusiast
Posts: 465
Joined: Fri Apr 25, 2003 7:44 pm
Location: end of www
Contact:

Post by benny »

PB wrote:> In other words, sources coded with the new IDE / codecaddy cannot be run
> with jAPBe for example without modifications

Why not? The compiler is what parses the source, not jaPBe...
I was referring to what blueznl wrote. I understood blueznl in that way that
he wants to code a plugin which parses the source before compilation
and whenever his plugin found a line which ends with the "_"-Symbol
it connects the line with the following one.

If I misunderstood blueznl then I am sorry :oops:
regards,
benny!
-
pe0ple ar3 str4nge!!!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> I was referring to what blueznl wrote

Ah, I see. Yes, it would break third-party pre-processors, at least until they
are updated to support it too. But too bad. :twisted:
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Personally i like long lines and would never use this 'feature'. I think it looks like a mess and not very 'Pure', but this is just my opinion. :wink:

P.S. please NO semicolons (;) on the end of lines, have you any idea of the mess you can get into if you miss just one of these little bas@%£ds out of a C/C++/Java source? :x
--Kale

Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Personally i like long lines and would never use this 'feature'

That's fine, because it would be optional. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

PB wrote:That's fine, because it would be optional. :)
True, but other peoples code would hurt my eyes! :? :wink:
--Kale

Image
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

you want me to add a converter as well? :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

i had some situations where i was very happy when i could split "very long" codelines (algos) in some lines for easier reading instead scrolling a very long horizontal codeline!

ok, we dont must use the ";" sign as end... it was just only a simple idea... so i called the "_" sign as idea, to add this at the end of each line you want to join...

sill looking forward and still hopping that one day this feature will be available in PureBasic too... it has nothing to do with C,C++,VB... its just a general issue.
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply