Page 1 of 2

Does Purebasic supports multiline programming?

Posted: Fri Feb 09, 2007 4:18 am
by SkyManager
Does Purebasic supports multiline programming

For example,
str1 + str2 + str3 + . . . . . .

Is it possible to be :
str1 + str2 \
str3 + str4 \
str5 + . . . . . . . . .

:?

Posted: Fri Feb 09, 2007 5:13 am
by netmaestro
Not at this time, but possibly in future. It's been discussed.

Posted: Fri Feb 09, 2007 10:08 am
by Kaeru Gaman
there is a preparser by Little John released in the german forum
http://www.purebasic.fr/german/viewtopic.php?t=10350

if you need help with usage, feel free to ask in that topic in english.

Posted: Fri Feb 09, 2007 4:24 pm
by Rook Zimbabwe
I don't see the benefit, BUT I admit I am ignorant... What would be the benefit of multiline programming? It looks (from that small example) like looser control of variables.

Shooting my mouth off again, thats me! :D

Posted: Fri Feb 09, 2007 7:33 pm
by Bonne_den_kule
This is one more reason to buy a widescreen LCD 8)
(I have an 22" widescreen at home)

Posted: Fri Feb 09, 2007 11:48 pm
by SkyManager
When too many coding within one single line, particularly when some codes are off-screen, the errors will not be seen easily. :twisted:

Posted: Sat Feb 10, 2007 8:23 am
by u9
Rook Zimbabwe wrote:I don't see the benefit, BUT I admit I am ignorant...
Yeah you probably are... but that seems to be a virtue of many people on this forum. I think many of these people only damage PB's user base. But enough of my political statement.

The advantage of being able to split up a line is especially apparent when the line becomes wider then the width of the screen. E.g. complex if-statements can be made more readable with more control over source code layout.

Posted: Sat Feb 10, 2007 9:15 am
by SkyManager
Anyway, the main job of IDE and the main purpose of a good language is to help programmers to de-bug their software.

Splitting a long line of code is certainly helpful in debugging softwares :?

Posted: Sat Feb 10, 2007 10:29 am
by Pantcho!!
Benefit?
for example programming CGI embedding html inside purebasic
It sucks to have the html added in 1 line or add a closing " to each line.

like PHP is used.

this will help a lot.

Posted: Sat Feb 10, 2007 11:09 am
by Derek
u9 wrote:
Rook Zimbabwe wrote:I don't see the benefit, BUT I admit I am ignorant...
Yeah you probably are... but that seems to be a virtue of many people on this forum. I think many of these people only damage PB's user base. But enough of my political statement.

The advantage of being able to split up a line is especially apparent when the line becomes wider then the width of the screen. E.g. complex if-statements can be made more readable with more control over source code layout.
I think overly rude people damage PB's user base as well but that's just my opinion.

Anyway that would indeed be a complex IF statement if it were that long, perhaps you should be looking at shorter variable names. :P

Posted: Sat Feb 10, 2007 12:22 pm
by Trond
It's for things like this:

Code: Select all

MainWindow = OpenWindow(#PB_Any, 100, 100, 512, 384, "My Window Title", #PB_Window_Invisible | #PB_Window_Maximize | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_SystemMenu)

Posted: Sat Feb 10, 2007 12:28 pm
by PB
And for things like this:

Code: Select all

a$=RegistryReadString(#HKEY_CURRENT_USER,"Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.txt","MRUListEx")

Code: Select all

MyLIG.l=ListIconGadget(#MyListIconGadget, 5, 32, 200, 164, "Title", 0, #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_MultiSelect | #PB_ListIcon_AlwaysShowSelection)

Posted: Sat Feb 10, 2007 12:31 pm
by Trond
Not to speak of if you get the position and state of the window from the registry!

Posted: Sat Feb 10, 2007 12:34 pm
by Derek
O.k. I stand corrected.

Still think u9 was a bit off though.

Posted: Sat Feb 10, 2007 2:02 pm
by Trond
It would clean up this:

Code: Select all

Out("sprite(" + \Name + ", " + Str(Value) + ", " + Str(\Width) + ", " + Str(\Height) + ", " + Str(\Left) + ", " + Str(\Right) + ", " + Str(\Bottom) + ", " + Str(\Top) + ", " + Str(\Transparent) + ", " + Str(\Smooth) + ", " + Str(\Preload) + ", " + Str(\BoundingBox) + ", " + Str(\Precise) + ", " + Str(\Origin\X) + ", " + Str(\Origin\Y) + ", " + Str(\SubimageCount) + ")")