How can I wrap long lines of code?

Just starting out? Need help? Post your questions and find answers here.
benco5000
User
User
Posts: 13
Joined: Mon Mar 01, 2010 8:56 pm

How can I wrap long lines of code?

Post 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.
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: How can I wrap long lines of code?

Post by Foz »

Nope. No wrapping of long lines.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: How can I wrap long lines of code?

Post 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.
Last edited by Kaeru Gaman on Wed Mar 03, 2010 6:19 pm, edited 1 time in total.
oh... and have a nice day.
benco5000
User
User
Posts: 13
Joined: Mon Mar 01, 2010 8:56 pm

Re: How can I wrap long lines of code?

Post by benco5000 »

any chance we can encourage developers to reconsider?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: How can I wrap long lines of code?

Post by Kaeru Gaman »

use the forums search, read the Feature-Request-Section.
oh... and have a nice day.
Little John
Addict
Addict
Posts: 4777
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: How can I wrap long lines of code?

Post 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
Post Reply