[Implemented] line continuation or line split?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

[Implemented] line continuation or line split?

Post by Tenaja »

Ok, I saw quite a few requests for this... is it implemented yet? I couldn't find it in the manual. Quite a few requests, but no conclusion.

And, yes, I NEED it for two reasons: a) long & structured array initializations, and b) complex conditional tests with very descriptive var names. Yes, I find it much easier to read the code with it in both of those conditions. For those who don't want it, it's always easy to skip it. for those who need it, it's VERY helpful.

...and I'll even bet that Fred can implement it with only one, maybe two lines of (basic) code.

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

Re: line continuation or line split?

Post by blueznl »

I'm not so sure this one is high on his list, it has been around for ages I fear.

I can only help here in a limited way. CodeCaddy preprocesses your code and glues 'multilines' together, but it doesn't do includes.
( 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
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: line continuation or line split?

Post by netmaestro »

...and I'll even bet that Fred can implement it with only one, maybe two lines of (basic) code.
It isn't as simple as it seems at first glance and there are a few difficulties that you won't foresee until they start cropping up. Basically there are two approaches: The first is that the source is preprocessed to remove the continuation characters and glue the lines back together before being sent on to the compiler, the second is that the code goes to the compiler "as-is" and the compiler logic expects them and handles them appropriately. My guess is that the second option would appeal most to Fred and I know it presents challenges. I don't believe it's low on the todo list though, my guess would be he wants to implement it sooner rather than later. Just my opinion.
BERESHEIT
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: line continuation or line split?

Post by blueznl »

Well, netmaestro, if a pathethic programmer like me can do it, I'm pretty sure Fred can do it better :-)
( 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
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: line continuation or line split?

Post by Tenaja »

I've played with the same tutorial that Trond played with. With that format, the difference between newlines required and being optional is commenting out a single statement. Maybe PB is a little more intertwined with its code, but if it takes more than a half hour to implement, then I'd consider a whole rewrite using one of the many compiler compilers to make it more maintainable. :twisted:

It seems a common request...and it never hurts to just ask.

...and blueznl, I did install codecaddy and another plugin (PE Extension) that's supposed to support it, but they both screwed up my formatting. I think they'd likely be great for a new project, but frustrating when you've already got quite a bit of code. I'm trying to avoid plugins right now, too, because I'm planning a win7 upgrade, and every one I use will need double installation. Oh, yeah...I've had the IDE crash twice on me when changing settings, too, so that's another reason to keep to a bare minimum.
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: line continuation or line split?

Post by luis »

Tenaja wrote:Ok, I saw quite a few requests for this... is it implemented yet? I couldn't find it in the manual. Quite a few requests, but no conclusions
You can say that for a lot of other requests.
If you wanted just to ask if it was implemented then the right place should have been "Coding questions."

On the other end if you really just wanted to sneak in with a new re-re-re-request this is certainly the way to go, asking innocently about its status inside the "Feature Requests" area.

If is it ok to re-re-re-request then I have some of mine I would like to bump too into a fresh new thread, but I didnt' because I was under the impression Fred doesn't like that, and ultimately this is not MY forum.

Personally I don't see anything wrong in opening a similar or almost identical new request after a year or so, if the thread get a lot of positive replays this is a good indication the request is still desirable by the community. But, again...

About your re-re-re-request, I'm neutral.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: line continuation or line split?

Post by blueznl »

Tenaja, what do you mean with 'screwed up' your formatting? I'm a bit puzzled there... Could you explain to me what went wrong?
( 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
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: line continuation or line split?

Post by Tenaja »

It was probably the other plug in, not yours... indentation issues and such.
User avatar
Didelphodon
PureBasic Expert
PureBasic Expert
Posts: 450
Joined: Sat Dec 18, 2004 11:56 am
Location: Vienna - Austria
Contact:

Re: line continuation or line split?

Post by Didelphodon »

Maybe this helps you.

Cheers,
Didel.
Go, tell it on the mountains.
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: line continuation or line split?

Post by Little John »

... or this. :)

Regards, Little John
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: line continuation or line split?

Post by Tenaja »

Thanks, Didel. I've installed it, and it worked nicely on a short demo. Much obliged.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: line continuation or line split?

Post by Tenaja »

By the way, how do you close all of those pesky Debug windows? In my quick test, they were left floating all over the screen.

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

Re: line continuation or line split?

Post by blueznl »

Oh! We need to do a feature competition for multi line pre-processors! :-)

Code: Select all

;
;
a.s = "this is _
  a test"
;
b.i = 1 + _
  2 + 3
;
c.i = 1 + 2
  _ + 3
;
d.i = 1 + _     ; we're almost there...
  2 + 3
;
; and what line is the error reported?
;
e = 1 / _
  0
;
; that's all folks! :-)
;
8)
( 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
Didelphodon
PureBasic Expert
PureBasic Expert
Posts: 450
Joined: Sat Dec 18, 2004 11:56 am
Location: Vienna - Austria
Contact:

Re: line continuation or line split?

Post by Didelphodon »

Tenaja wrote:By the way, how do you close all of those pesky Debug windows? In my quick test, they were left floating all over the screen.

Thanks.
Debugwindows? When? Where? What?
Go, tell it on the mountains.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: line continuation or line split?

Post by blueznl »

Preferences, default debugger windows.
( 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... )
Post Reply