Page 1 of 1

IDE multiline

Posted: Fri Dec 28, 2012 2:50 pm
by michel
How is the exact syntax to work with?

Re: IDE multiline

Posted: Fri Dec 28, 2012 3:08 pm
by ts-soft
Here a small example:

Code: Select all

Procedure Test(a, ; first parameter
          b,
          c)      ; last parameter
  
  Debug a
  Debug b
  Debug c
EndProcedure

OpenWindow(0, #PB_Ignore, #PB_Ignore, 640, 480, "Test",
          #PB_Window_SystemMenu |
          #PB_Window_MinimizeGadget)
          
Test(10, 20,
      30)
      
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: IDE multiline

Posted: Fri Dec 28, 2012 4:42 pm
by michel
Hello,
Thank you for the example, nevertheless when I use this construction:

Code: Select all

query0$ = "Select typ,px,py,d1,d2,d,l,Id,typ from Ofenkonstruktion Where ('" + Str(x) + "'>=x1) And ('" + Str(x) + "'<x2) And" 
      query0$ = query0$ + " Ort='" + var_ort$ + "' And Ofen='" + var_ofen$ + "' order by px;" 
where I want to suppress part of the second line like this:

Code: Select all

query0$ = "Select typ,px,py,d1,d2,d,l,Id,typ from Ofenkonstruktion Where ('" + Str(x) + "'>=x1) And ('" + Str(x) + "'<x2) And",
+ " Ort='" + var_ort$ + "' And Ofen='" + var_ofen$ + "' order by px;"

produces "garbage" error

Re: IDE multiline

Posted: Fri Dec 28, 2012 4:48 pm
by ts-soft

Code: Select all

query0$ = "Select typ,px,py,d1,d2,d,l,Id,typ from Ofenkonstruktion Where ('" + Str(x) + "'>=x1) And ('" + Str(x) + "'<x2) And" + 
" Ort='" + var_ort$ + "' And Ofen='" + var_ofen$ + "' order by px;" 
:wink:

Line continuation feature, with the following operands: ',' '|' '+' And Or Xor

Re: IDE multiline

Posted: Fri Dec 28, 2012 4:52 pm
by Tenaja
I think it has more to do with the syntax error of a plus sign (+) following a comma (,).

Re: IDE multiline

Posted: Fri Dec 28, 2012 4:59 pm
by michel
Hello
Thank you ts-soft, it works. The syntax (',' '|' '+' And Or Xor) mad me run into trouble as I thought to use , (for and) to join the lines. I think the exact explanation when to use what has to be given in the future help of V5.1
michel

Re: IDE multiline

Posted: Fri Dec 28, 2012 5:09 pm
by ts-soft
You can linebreak after each operants, but not inside a stringliteral!

Re: IDE multiline

Posted: Fri Dec 28, 2012 7:06 pm
by VB6_to_PBx
i like the new Line continuation option in version 5.10 Beta 1

Code: Select all

;        _____Basic.pb

;        VB6=1033x768   PureBasic=1017x730  -16,-38  for Resizable Window


OpenWindow(0, 0, 0, 1017, 730, "VB6=1033x768   PureBasic=1017x730",
         #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | 
         #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )

Repeat
    Select WaitWindowEvent()
    Case #PB_Event_CloseWindow : End
    EndSelect    
ForEver