Does Purebasic supports multiline programming?

Just starting out? Need help? Post your questions and find answers here.
SkyManager
Enthusiast
Enthusiast
Posts: 339
Joined: Tue Jan 30, 2007 5:47 am
Location: Hong Kong

Does Purebasic supports multiline programming?

Post by SkyManager »

Does Purebasic supports multiline programming

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

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

:?
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Not at this time, but possibly in future. It's been discussed.
BERESHEIT
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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.
oh... and have a nice day.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Post 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
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

This is one more reason to buy a widescreen LCD 8)
(I have an 22" widescreen at home)
SkyManager
Enthusiast
Enthusiast
Posts: 339
Joined: Tue Jan 30, 2007 5:47 am
Location: Hong Kong

Post 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:
u9
User
User
Posts: 55
Joined: Tue May 09, 2006 8:43 pm
Location: Faroe Islands
Contact:

Post 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.
The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents. (Nathaniel Borenstein)
http://www.wirednerd.com
SkyManager
Enthusiast
Enthusiast
Posts: 339
Joined: Tue Jan 30, 2007 5:47 am
Location: Hong Kong

Post 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 :?
Pantcho!!
Enthusiast
Enthusiast
Posts: 538
Joined: Tue Feb 24, 2004 3:43 am
Location: Israel
Contact:

Post 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.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post 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
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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)
Last edited by PB on Sat Feb 10, 2007 12:31 pm, edited 1 time in total.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Not to speak of if you get the position and state of the window from the registry!
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

O.k. I stand corrected.

Still think u9 was a bit off though.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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) + ")")
Post Reply