Is there such a thing as (statement continuation character) ?

Just starting out? Need help? Post your questions and find answers here.
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Is there such a thing as (statement continuation character) ?

Post by vmars316 »

Hello & Thanks ,
Correct code:
StandardFile$ = GetGadgetText(pathFile) ; set initial file+path to display openfile ;keyword

No go code:
StandardFile$ =
GetGadgetText(pathFile) ; set initial file+path to display openfile ;keyword

This is as close as I could get:
StandardFile$ = "" +
GetGadgetText(pathFile) ; set initial file+path to display openfile ;keyword


Is there such a thing as (statement continuation character) ?
I would like to make all keyword statements to begin as 'first character' on a separate line .
It would make my documentation efforts eaasier .

Thanks for your on going help .
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
User avatar
Demivec
Addict
Addict
Posts: 4082
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Is there such a thing as (statement continuation character) ?

Post by Demivec »

vmars316 wrote: Mon Nov 28, 2022 11:09 pmIs there such a thing as (statement continuation character) ?
I would like to make all keyword statements to begin as 'first character' on a separate line .
No, there is no statement continuation character.

There is the possibility of line continuation in some select cases. Each of those cases is after the start of an expression or list of parameters.
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: Is there such a thing as (statement continuation character) ?

Post by vmars316 »

Ok , got it , Thanks
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
Fred
Administrator
Administrator
Posts: 16581
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Is there such a thing as (statement continuation character) ?

Post by Fred »

That said, we could add the '=' as continuation character, it doesn't look like an issue to me.
User avatar
mk-soft
Always Here
Always Here
Posts: 5313
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Is there such a thing as (statement continuation character) ?

Post by mk-soft »

Fred wrote: Wed Nov 30, 2022 3:20 pm That said, we could add the '=' as continuation character, it doesn't look like an issue to me.
An equal sign '=' at the end looks technically very strange.
I usually know the sign '_' as a continuation.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Fred
Administrator
Administrator
Posts: 16581
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Is there such a thing as (statement continuation character) ?

Post by Fred »

you can do it in C# and it doesn't look strange to me...
User avatar
Demivec
Addict
Addict
Posts: 4082
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Is there such a thing as (statement continuation character) ?

Post by Demivec »

What about also adding an open paren '(' ?
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Is there such a thing as (statement continuation character) ?

Post by Marc56us »

:idea: I think it would be good to use the underscore like in other Basics (or the backslash like in other languages)
AZJIO
Addict
Addict
Posts: 1298
Joined: Sun May 14, 2017 1:48 am

Re: Is there such a thing as (statement continuation character) ?

Post by AZJIO »

Underscore '_' and a space preceding it.
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: Is there such a thing as (statement continuation character) ?

Post by vmars316 »

Only this works for me:

Code: Select all

    StandardFile$ = "" + 
    GetGadgetText(pathFile)    ;keyword 
Thanks All
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Is there such a thing as (statement continuation character) ?

Post by Marc56us »

vmars316 wrote: Wed Nov 30, 2022 5:36 pm Only this works for me:

Code: Select all

    StandardFile$ = "" + 
    GetGadgetText(pathFile)    ;keyword 
Thanks All
there are others :wink:
General Syntax Rules
Line continuation
Long expressions can be split across several lines. A split line has to end with one of the following operators: plus (+), comma (,), or (|), And, Or, Xor.


Adding ' = ' to this is indeed simple
The rest requires testing (space or tab) before _ or \
:|
AZJIO
Addict
Addict
Posts: 1298
Joined: Sun May 14, 2017 1:48 am

Re: Is there such a thing as (statement continuation character) ?

Post by AZJIO »

vmars316 wrote: Wed Nov 30, 2022 5:36 pm

Code: Select all

    StandardFile$ = "" + 
    GetGadgetText(pathFile)    ;keyword 
This is a bad option, you are doing string concatenation programmatically. The options suggested above use string concatenation at compile time. It's the same as if you replaced all constants with variables.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 579
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Is there such a thing as (statement continuation character) ?

Post by spikey »

I used to find _ really ugly in VB but I suppose it does make it clear that a continuation was intentional and not a typo. I think that equal and left parenthesis would be useful though.
vmars316
Enthusiast
Enthusiast
Posts: 464
Joined: Fri Jun 29, 2012 12:24 am
Contact:

Re: Is there such a thing as (statement continuation character) ?

Post by vmars316 »

Yes , I like the = idea .
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8422
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Is there such a thing as (statement continuation character) ?

Post by netmaestro »

If we're voting I think an underscore preceded by a space is the most intuitive. But be careful of my opinion, I could be a bot.
BERESHEIT
Post Reply