Page 1 of 1

How can I wrap long lines of code?

Posted: Wed Mar 03, 2010 6:11 pm
by benco5000
I've looked through the docs, and forum. The latest I found was an entry
from several months ago. Was this ever corrected so we could wrap long
lines of code?

Code: Select all

;------------------------------------------------------------
; create a main window
;------------------------------------------------------------
mainWin = OpenWindow(#PB_Any, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_SizeGadget |#PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)

vs.

;------------------------------------------------------------
; create a main window
;------------------------------------------------------------
mainWin = OpenWindow(#PB_Any,                                  ;; create a window and assign id to mainWin
                      0, 0, 270, 140,                          ;; window size
                      "ListViewGadget",                        ;; name of window appears in title bar
                      #PB_Window_SystemMenu |                  ;; include a system menu
                      #PB_Window_SizeGadget |                  ;; allow resizing
                      #PB_Window_MinimizeGadget |              ;; allow minimize button
                      #PB_Window_MaximizeGadget |              ;; allow maximize button
                      #PB_Window_ScreenCentered)               ;; center on screen
thanks in advance.

Re: How can I wrap long lines of code?

Posted: Wed Mar 03, 2010 6:13 pm
by Foz
Nope. No wrapping of long lines.

Re: How can I wrap long lines of code?

Posted: Wed Mar 03, 2010 6:17 pm
by Kaeru Gaman

Code: Select all

#MyWindowFlags = #PB_Window_SystemMenu | #PB_Window_SizeGadget |#PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered

mainWin = OpenWindow(#PB_Any, 0, 0, 270, 140, "ListViewGadget", #MyWindowFlags )
there's no need to write long lines since PB is not an interpreted language.
literals and constants are processed at compiletime, no speed gain in putting it in one line.

Re: How can I wrap long lines of code?

Posted: Wed Mar 03, 2010 6:18 pm
by benco5000
any chance we can encourage developers to reconsider?

Re: How can I wrap long lines of code?

Posted: Wed Mar 03, 2010 6:19 pm
by Kaeru Gaman
use the forums search, read the Feature-Request-Section.

Re: How can I wrap long lines of code?

Posted: Wed Mar 03, 2010 7:10 pm
by Little John
benco5000 wrote:

Code: Select all

;------------------------------------------------------------
; create a main window
;------------------------------------------------------------
mainWin = OpenWindow(#PB_Any, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_SizeGadget |#PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)

vs.

;------------------------------------------------------------
; create a main window
;------------------------------------------------------------
mainWin = OpenWindow(#PB_Any,                                  ;; create a window and assign id to mainWin
                      0, 0, 270, 140,                          ;; window size
                      "ListViewGadget",                        ;; name of window appears in title bar
                      #PB_Window_SystemMenu |                  ;; include a system menu
                      #PB_Window_SizeGadget |                  ;; allow resizing
                      #PB_Window_MinimizeGadget |              ;; allow minimize button
                      #PB_Window_MaximizeGadget |              ;; allow maximize button
                      #PB_Window_ScreenCentered)               ;; center on screen
Using my preprocessor LPP, it would look something like this: :)

Code: Select all

$Lpp

;------------------------------------------------------------
; create a main window
;------------------------------------------------------------
mainWin = OpenWindow(#PB_Any, _                                ;; create a window and assign id to mainWin
                      0, 0, 270, 140, _                        ;; window size
                      "ListViewGadget", _                      ;; name of window appears in title bar
                      #PB_Window_SystemMenu | _                ;; include a system menu
                      #PB_Window_SizeGadget | _                ;; allow resizing
                      #PB_Window_MinimizeGadget | _            ;; allow minimize button
                      #PB_Window_MaximizeGadget | _            ;; allow maximize button
                      #PB_Window_ScreenCentered)               ;; center on screen
Regards, Little John