
Continuation line for source file
As long as the (continous) line i seperated bu a comma, then it's all good for me.. 

AMD Athlon XP2400, 512 MB RAM, Hercules 3D Prophet 9600 256MB RAM, WinXP
PIII 800MHz, 320 MB RAM, Nvidia Riva Tnt 2 Mach 64 (32MB), WinXP + Linux
17" iMac, 1.8 GHz G5, 512 MB DDR-RAM, 80 GB HD, 64 MB Geforce FX 5200, SuperDrive, OSX
Re: continuation and white spaces
How about this line, oldefoxx? (Taken from the 'Sprite_SpecialFX.pb' file):oldefoxx wrote:as a r u l e y o u do n ot pu t sp
a
c es in side o f w o r d s. right?
So why would you want to haphazardly put spaces or new lines into terms and commands -- just to prove that you can? That serves no purpose, and onlyh makes it harder to read and maintain your code. In addition, it also makes the files bigger and puts a much greater demand on the compiler. which has to make sence of whether
Code: Select all
MessageRequester("Information", "This is a little demo of PureBasic real-time 2D effects:"+Chr(10)+Chr(10)+"F1: Enable/Disable RGB Filters"+Chr(10)+"F2: Enable/Disable AlphaChannel"+Chr(10)+"F3: Enable/Disable Shadow"+Chr(10)+"F4: Start screen fading"+Chr(10)+"F5: Enable/Disable AlphaChannel color rotation"+Chr(10)+"+/-: Add/Remove PureBasic AlphaBlending sprite"+Chr(10)+Chr(10)+"Use the mouse :)... Enjoy !", #MB_ICONINFORMATION)
Can you see where a simple "_" would break this up nicely and still leave it quite readable?
As for adding to file size... I think my source can stand an extra byte here and there for the "_" character

This would be a nice option for us to have...
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Re: continuation and white spaces
Code: Select all
a$= "This is a little demo of PureBasic real-time 2D effects:"
a$+Chr(10)
a$+Chr(10)+"F1: Enable/Disable RGB Filters"
a$+Chr(10)+"F2: Enable/Disable AlphaChannel"
a$+Chr(10)+"F3: Enable/Disable Shadow"
a$+Chr(10)+"F4: Start screen fading"
a$+Chr(10)+"F5: Enable/Disable AlphaChannel color rotation"
a$+Chr(10)+"+/-: Add/Remove PureBasic AlphaBlending sprite"
a$+Chr(10)
a$+Chr(10)+"Use the mouse :)... Enjoy !"
MessageRequester("Information", a$, #MB_ICONINFORMATION)
This is also quite readable
Code: Select all
winID=OpenWindow(#_win, 216, 0, 480, 320, _
#PB_Window_SystemMenu | _
#PB_Window_MinimizeGadget | _
#PB_Window_SizeGadget | _
#PB_Window_TitleBar | _
#PB_Window_ScreenCentered , _
"NoSidewaysScrolling")
Re: continuation and white spaces
More readable is a matter of opinion, but it certainly involves a lot more typing on my part! BTW, your example is pretty much the way we are currently forced to do it if we don't want a line 500 characters long. It'd be nice to have a choice. That way, we can do less typing and still have everything nicely indented and readable and you can continue to self-chain your variables (a$ = a$ + ..., a$ = a$ + ... {I thought BASIC had moved beyond this?}) as much as you want...Works for both of us!GPI wrote:Is much better readable and you can see the formation of the message.Code: Select all
a$= "This is a little demo of PureBasic real-time 2D effects:" a$+Chr(10) a$+Chr(10)+"F1: Enable/Disable RGB Filters" a$+Chr(10)+"F2: Enable/Disable AlphaChannel" a$+Chr(10)+"F3: Enable/Disable Shadow" a$+Chr(10)+"F4: Start screen fading" a$+Chr(10)+"F5: Enable/Disable AlphaChannel color rotation" a$+Chr(10)+"+/-: Add/Remove PureBasic AlphaBlending sprite" a$+Chr(10) a$+Chr(10)+"Use the mouse :)... Enjoy !" MessageRequester("Information", a$, #MB_ICONINFORMATION)

This could be added to the editor or the compiler: If it's done in the editor, then the editor would have to do some simple checks like make sure that the "_" character is not in the middle of a quote (this is a standard guideline in other languages that support the continuation character) and then send the converted ascii file with the "_" removed (and the extended lines put back on the same line) to the compiler.
Of course, if it's done in the compiler then that extra step would not be necessary as the compiler would know how to deal with it.
Russell
p.s. This is not a feature that no one would use, but would be useful for actually keeping code more readable by keeping important information on the same screen without having to scroll to the right to see everything. Must be somewhat desired, considering how many times it has been asked for, eh?

*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Some simple code that would do it:
Being very little extra code at the point where the next line is accessed.
Code: Select all
While LinesLeftToProcess
z$ = GetNextLine()
While Right(z$, 1) = "_" ; where _ is continuation
z$ + GetNextLine()
Wend
ParseAndProcessLine(z$)
Wend
In C and some other languages the ";" character is used to denote the end of a "line". Although it can be annoying having to remember this, the plus side is that there's a lot more freedom as to where you can put your code, since CR and LF are essentially ignored by the compiler.
This is not the direction I'd like to see PB go, however. "_" would be much more Basic-like...
Russell
This is not the direction I'd like to see PB go, however. "_" would be much more Basic-like...
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Re: continuation and white spaces
> a$+Chr(10)+"F1: Enable/Disable RGB Filters"
> a$+Chr(10)+"F2: Enable/Disable AlphaChannel"
Yes, this is readable, but it presents two problems:
(1) More typing.
(2) More code in the app.
Using a$="1" : a$+"2" is more code than just a$="12" alone... which
is what a line continutation would provide. (Without line continuation,
you're using more code to build the string).
> a$+Chr(10)+"F2: Enable/Disable AlphaChannel"
Yes, this is readable, but it presents two problems:
(1) More typing.
(2) More code in the app.
Using a$="1" : a$+"2" is more code than just a$="12" alone... which
is what a line continutation would provide. (Without line continuation,
you're using more code to build the string).
I'd like a continuation character too - perhaps "~" tilde character at the end or beginning of a line. Would be better than "_" 'cos the underscore char is allowable in variable names, but "~" isnt used by PB anywhere (that I can see) and could therefore become a reserved character making it easier to parse. Perhaps it would be a possibility for JaPBE (unless it already does that)...
Ta - N
Using " _" (that is, a space followed by an underscore as the last 2 characters
on a line) is the time-tested method used by Visual Basic and makes perfect
sense, IMO. As for the compiler reporting the line on which an error occurred,
it would report the first line, since the compiler considers all subsequent lines
to be one line (internally) anyway. I see no problem with this at all. It also
makes cutting/pasting of Visual Basic code very simple, as you don't need to
reformat the multiple lines to work in PureBasic.
on a line) is the time-tested method used by Visual Basic and makes perfect
sense, IMO. As for the compiler reporting the line on which an error occurred,
it would report the first line, since the compiler considers all subsequent lines
to be one line (internally) anyway. I see no problem with this at all. It also
makes cutting/pasting of Visual Basic code very simple, as you don't need to
reformat the multiple lines to work in PureBasic.

I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
- seems to me that Fred released the IDE source so that people would contribute changes themselves and *good/nice* changes would be adopted into the standard IDE...
Everyone seems to like the idea of being able to break a command over several lines, I assume it can be done in the IDE without affecting the Compiler, so perhaps someone other than Fred could do it? I'm not volunteering (wouldnt want to
humiliate
myself )
Everyone seems to like the idea of being able to break a command over several lines, I assume it can be done in the IDE without affecting the Compiler, so perhaps someone other than Fred could do it? I'm not volunteering (wouldnt want to


Ta - N