[Implemented] Wrapping long lines in editor

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

[Implemented] Wrapping long lines in editor

Post by BackupUser »

Restored from previous forum. Originally posted by Stan.

I may have overlooked it ... But I need to wrap long lines in the editor :
for instance :

PrintN( "aaaaa" + "bbbbb" + "ccccc" + "ddddd" + ... + "zzzz" )

as

PrintN( "aaaaa" + "bbbbb" + "ccccc"
+ "ddddd" + ... + "zzzz" )

Is that possible ?

TIA

Learning and Love are what life is all about ... [ PB. registered user ]
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.
PrintN( "aaaaa" + "bbbbb" + "ccccc"
+ "ddddd" + ... + "zzzz" )

Is that possible ?
Not yet. I suggested it in the past, by way of emulating Visual Basic's "line
continuation" code (space then underscore), so hopefully Fred will implement
it one day. .

PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Personally, I'd prefer plain line wrapping (with automatic indentation), just the way TextPad allows you to do. But, again, everybody may have an opinion on this.

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.
El_Choni wrote:
Personally, I'd prefer plain line wrapping (with automatic indentation), just the way TextPad allows you to do. But, again, everybody may have an opinion on this.
Mhhhh... surely it would be a nice feature for some coders... but i dont needed this until now and i think who are coding professional (not all conditions i.e. in one line ) dont really need this...!? Please dont misunderstand me...

Hi El_Choni:
I think line wrapping with automatic indentitaion would not really easy to code and to be understand from the compiler..!? Btw, i have tested my PB editor v.290 and i have not found any row (linelengh) limit... Arent 1000 chars in one line enough?

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.

Hi MrVain:

My intention is far from coding huge lines. I want automatic line wrapping because very often the line goes past the right border, and you have to scroll right, which is what annoys me (i.e., any OpenWindow line often does this). And, if the line is wrapped, I'd like it to maintain the indentation of the previous line so things don't get messed up. And one of the reasons I'm asking for this is that the RichEdit class (which I guess is used by the editor) allows this behaviour easily.

But, as I said before, Thorsten, I guess everybody has his/her own preferences regarding code editing, so I don't really expect to see my opinion prevailing.

BTW, you're quite a massive poster! Trying to win your third star XD?

Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> not all conditions i.e. in one line ) dont really need this...!?
> Arent 1000 chars in one line enough?

1000 chars are not long enough for longs strings of text or complex maths
formulas that use many API constant names... And it also depends on your
screen's size... I use 640x480 on my laptop which means I can only ever see a
maximum of 77 characters on any line, which is very little, IMO.

For example, here's a long line from my vis2pure app. Yes, I know I could break
it down into two lines and use al$(ti)=al$(ti)+ but wouldn't that use more
memory and/or code, as opposed to doing it all in one line of code?

Code: Select all

; This comment line is 77 chars long - the maximum view for a 640x480 screen.
al$(ti)=" SetWindowLong_("+Mid(a$,2,999)+"_hWnd,#GWL_STYLE,GetWindowLong_("+Mid(a$,2,999)+"_hWnd,#GWL_STYLE)|#BS_LEFTTEXT) ; Right-aligned."

PB - Registered PureBasic Coder

Edited by - PB on 19 February 2002 04:41:20
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TronDoc.

as someone mentioned, indentation is a major cause of lines
going far to the right. but I find indentation helps make
my code much more readable.. ..until I've indented
several times and the line wraps back to the
start of the line which makes it even
more unreadable than before! :wink:

Code: Select all

for somelongvariablenameAndOrfunction = 1 to someotherLongname step somebigvariablenameOrfunctionalso
        do some really involved stuff
               with maybe some select
                      and case choices with
                            a few if
                                   else
                                   endifs
and before you know it, your wrapping....
I don't have the answer, but I sure can generate the problems! :D
Joe

elecTRONics DOCtor
{registeredPB}P150 32Mb w98/DOS/Linux NO DirX NO IE :wink:
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plouf.

why do i always believe that you can do it with the / as the last character ?
i.e.

aaa/
bbb.s = "Tralalo"
messagerequester("this is a string",aaabbb.s,0)

does exist in any old version or was a quote for the future ?

Christos
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by MrVainSCL.

hehe... hi all...

you all are right and you have really good reasons to implent auto warp wrap lines to one of the next version... Now i am on your site and want it too, hehe

Hi Elchoni
I agree... you are right in all points! Btw. do you really think that i´m a massive poster? If someone think that i flood this forum, please tell me and i will try to reduce it Bye @ all...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win98SE + Updates...

greetz
MrVainSCL! aka Thorsten
Post Reply