[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

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

Post by blueznl »

trust me, one day there's gonna' be a v4

and my oh my, do i bet there will be some major changes... and do i look forward to them, yeah!

how was it... what did jack burton always say...
This is Jack Burton in the Pork-Chop Express and I'm talkin' to whoever's listenin' out there. It's like I told my last wife, I says, "Honey, I never drive faster than I can see. Besides that, it's all in the reflexes."
You just listen to the Pork-Chop Express and take his advice on a dark and stormy night. When some wild-eyed, 8 foot tall, maniac grabs your neck, taps the back of your head up against a bar-room wall, he looks you crooked in the eye and asks you if you've paid your dues, you just stare that big sucker right back in the eye and remember what ol' Jack Burton always says at a time like that "Have you paid your dues, Jack?" "Yes sir, the cheque is in the mail."

You just listen to the old Pork-Chop Express here and take his advice on a dark and stormy night, when the lightning's crashin', the thunder's rollin' and the rain's comin' down in sheets thick as lead. Just remember what old Jack Burton does when the earth quakes and the poison arrows fall from the sky and the pillars of heaven shake. Yeah, Jack Burton just looks that big old storm right square in the eye and he says, "Gimme your best shot, pal. I can take it."
give us your best shot, fred, we can take it :-)
Last edited by blueznl on Fri Dec 09, 2005 4:35 pm, edited 1 time in total.
( 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 »

:D

Code: Select all

OpenWindow( #Window,                        _
               x, y,                        _
               InnerWidth,                  _  ; Not Outer!
               InnerHeight,                 _  ; Yoiks, can comment each part!
               #PB_Window_SystemMenu |      _  ; Gimme an eXit!
               #PB_Window_WindowCentered,   _  ; Look Ma ...
               "WooHoo"                     _  ; ... no sideways scrolling!
          )
@}--`--,-- 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 »

turns out to be not too easy, at least to do it fast enough... let's turn it into a little coding challenge... see here

viewtopic.php?p=114887#114887
( 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... )
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

no need for a "_"
it should be possible after any operator or separator (except this one -> )

Code: Select all

a + 2 + ;not finished line
a + 3   ;continues here

a + 2 + a + 3 ;same code
Dri
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

I think I prefer continuation character, no ambiguity. More readable.

Code: Select all

a = b + c +        ; Obviously incomplete but ..
d + e              ; .. is this the continuation or incrementing d?

a = b + c          ; Looks complete but ..
+ d                ; .. is this an error or continuation?
Just MHO.
@}--`--,-- A rose by any other name ..
dagcrack
Addict
Addict
Posts: 1868
Joined: Sun Mar 07, 2004 8:47 am
Location: Argentina
Contact:

Post by dagcrack »

Dare2 wrote::D

Code: Select all

OpenWindow( #Window,                        _
               x, y,                        _
               InnerWidth,                  _  ; Not Outer!
               InnerHeight,                 _  ; Yoiks, can comment each part!
               #PB_Window_SystemMenu |      _  ; Gimme an eXit!
               #PB_Window_WindowCentered,   _  ; Look Ma ...
               "WooHoo"                     _  ; ... no sideways scrolling!
          )
Sounds like easy to implement on jaPBe but as said, then your sources wouldnt compile on other IDEs since they dont have their pre-processor ready for this.. But then, you could simply have a button "flatten" or something, so all the lines are flatten and you can share your nasty "codez"...
! Black holes are where God divided by zero !
My little blog!
(Not for the faint hearted!)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

well, like it or not, i've added it to codecaddy, some final stuff to be done...
( 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... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

( 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... )
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Kale wrote: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:
I've completely changed my mind on this subject and now i would very much like to see a continuation character added to PB too, to break up long lines.

I've now grown to like broken lines... :oops:

Any news on this Fred?
--Kale

Image
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It's still on the todo list ;).
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

DarkDragon wrote:(PureBasic = Basic) And (VisualBasic <> Basic).

IIRC Deeem2031 made a precompiler for this
Actually, the following looks more accurate:

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

I believe PB have moved a bit from the Basic language just like VB, IB, RB, EB, etc. This is a good thing, IMO.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

i have been called a turncoat by admitting i like like continuation characters as well :?

i just wonder what is the best approach... using a line continuation char at the END of the current line or at the BEGINNING of the next line...

although codecaddy does one at the end somehow the next sample looks quote good...

Code: Select all

; codecaddy style
;
a.s = "dit is een test en laten we wel wezen, dit " + _
  "is nog een test"

; at-the-beginning style
;
a.s = "dit is een test en laten we wel wezen, dit "
  _ + "is nog een test"

perhaps the second variant, although i haven't seen it in any language, may be the best option?

somehow this
( 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... )
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I like the continuation charater at the end of the line i think. :)

Code: Select all

;Open a window 
hWnd.l = CreateWindowEx_(0,_
								"WindowClass",_
								"Hello World",_
								#WS_VISIBLE | #WS_OVERLAPPEDWINDOW | #WS_SIZEBOX ,_
								WindowXPosition,_
								WindowYPosition,_
								WindowWidth,_
								WindowHeight,_
								0,_
								0,_
								GetModuleHandle_(#Null),_
								0)
--Kale

Image
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

auto-formatting and word-wrap

Post by USCode »

If the IDE did auto-formatting then the IDE could just word-wrap the long lines and apply appropriate formatting to those lines. I've used an IDE that does this and it's VERY nice.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

Fred: It's still on the todo list Wink.
Nice to hear :wink:
va!n aka Thorsten

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