[Implemented] Very long statements
[Implemented] Very long statements
Hey all
I want to like to see the next feature:
Example:
TextGadget(0, 5, 5, WindowWidth()-10, WindowHeight()-10, "XpmTool Lite v. 0.9"+Chr(10)+"View and convert between Xpm and Bmp files."+Chr(10)+"Written in PureBasic by El_Choni")
Change to _
TextGadget(0, 5, 5, WindowWidth()-10, _
WindowHeight()-10, _
"XpmTool Lite v. 0.9" _
+Chr(10)+ _
"View and convert between Xpm and Bmp files." _
+Chr(10)+ _
"Written in PureBasic by El_Choni")
Contantenation with strings : only : "&" symbool
Kind regards
I want to like to see the next feature:
Example:
TextGadget(0, 5, 5, WindowWidth()-10, WindowHeight()-10, "XpmTool Lite v. 0.9"+Chr(10)+"View and convert between Xpm and Bmp files."+Chr(10)+"Written in PureBasic by El_Choni")
Change to _
TextGadget(0, 5, 5, WindowWidth()-10, _
WindowHeight()-10, _
"XpmTool Lite v. 0.9" _
+Chr(10)+ _
"View and convert between Xpm and Bmp files." _
+Chr(10)+ _
"Written in PureBasic by El_Choni")
Contantenation with strings : only : "&" symbool
Kind regards
> talk about ugly code
Perhaps, but having a long line broken down can be very useful at times.
One immediate advantage is not having to horizontally scroll your source
code to see what's on the long lines. It means you don't have to reach for
your mouse, too -- which makes for faster and more convenient coding.
Perhaps, but having a long line broken down can be very useful at times.
One immediate advantage is not having to horizontally scroll your source
code to see what's on the long lines. It means you don't have to reach for
your mouse, too -- which makes for faster and more convenient coding.
Last edited by PB on Thu Jun 19, 2003 3:13 am, edited 4 times in total.
No, that not good. Then you must implant a Line-End-Char and thats isn't good.Fred wrote:I agree with Inner, I think I will implemente it like that.
or what is the diffrent between
Code: Select all
if a=10
b=11
endif
Code: Select all
if a=10 b=11 endif
Thats why, c and Pascal has a line-end-Char (;)
A link-Char for PB would be nice. "_" don't look nice... but which char is free?
Edit: Ok, the "," would be a seperator of parmeters and a linelinker...
You could have a multiline paramater. Say |.
If a line begins with | then that line continues until a line is encountered that ends with |. Between the 2 |s any EOFs are ignored.
The | is only significant at the beginning and end of the line. Any |s embedded within the lines are treated as normal characters.
If a line begins with | then that line continues until a line is encountered that ends with |. Between the 2 |s any EOFs are ignored.
The | is only significant at the beginning and end of the line. Any |s embedded within the lines are treated as normal characters.
what happens in this condition then
OpenWindow(#DEWINDOW, 0, 0,640,400, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget,file)
Very messy
, and would slow the preprocessor down something aweful.
As Fred said he liked the traditional way..
however what would also be usefule is.
so you can break | into multipal lines as well as those , 
OpenWindow(#DEWINDOW, 0, 0,640,400, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget,file)
Very messy

As Fred said he liked the traditional way..
Code: Select all
Foo(apple,
fruity,
basket,
food,
fight)
Code: Select all
OpenWindow(#DEWINDOW,0, 0,640,400,#PB_Window_SystemMenu
| #PB_Window_ScreenCentered
| #PB_Window_SizeGadget,file)

I hadn't thought of the overloaded |. Perhaps [] instead or ASP style <% %>.
GPI points out the problem of allow breaks accross lines without a EOL character like ;.
It could work if the line breaks were only allowed within the brackets. ie.
Line breaks inside brackets = white space.
Line breaks outside brackets = EOL.
This would take care of GPIs scenario.
GPI points out the problem of allow breaks accross lines without a EOL character like ;.
It could work if the line breaks were only allowed within the brackets. ie.
Line breaks inside brackets = white space.
Line breaks outside brackets = EOL.
This would take care of GPIs scenario.
-
- User
- Posts: 50
- Joined: Fri Apr 25, 2003 7:21 pm
- Location: The World is my country, all mankind are my brethren, and to do good is my religion.
- Contact:
Yes, but not ALL the long lines are procedure calls. In my case sometimes are IFs and ELSEIFs or formulas that dosen't use commas. Another way is inside strings.Inner wrote:I agree, but not on the _ implymentation, same way that C does it would be fine..
Foo(arg1,
arg2,
arg3,
arg4,
....)
Would be neat
In those cases an underline could be usefull (specially in big strings)
ARGENTINA WORLD CHAMPION
Ricardo,
Regarding Strings, I think the heredoc format in PHP is great. That would be really useful if it was supported:
http://www.php.net/manual/en/language.t ... ax.heredoc
Any extended conditions could be placed inside brackets, and the linebreaks would therefore be ignored.It could work if the line breaks were only allowed within the brackets. ie.
Line breaks inside brackets = white space.
Line breaks outside brackets = EOL.
Regarding Strings, I think the heredoc format in PHP is great. That would be really useful if it was supported:
http://www.php.net/manual/en/language.t ... ax.heredoc