Announcement

Collapse
No announcement yet.

Quote marks in PRINT statements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lance Edmonds
    replied
    It would be much more likely we'd use the same method supported by PB/CC and PB/Win:
    Code:
    A$ = "Clearing his throat, he muttered a sharp ""Hello!"", then scuttled back into his cave."
    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • David J Venable
    replied
    Here's a good area for a request for future versions.
    How about C style escape sequences, such as:

    print "The lady said, \"How's it going?\"\n"


    ------------------

    Leave a comment:


  • Amos Vryhof
    Guest replied
    Code:
    FUNCTION quote$(inString$)
      FUNCTION=chr$(34)+inString$+chr$(34)
    END FUNCTION
    ------------------
    Amos
    mailto:[email protected][email protected]</A>

    Leave a comment:


  • Leon Stennett
    replied
    Originally posted by Fred Katzel:
    Hi
    Is there some way to put quote marks in PRINT statements. When I
    programmed in PLI or FORTRAN by putting "" in a PRINT statement
    would put quote marks in the OUTPUT statement. ei:
    PRINT "I said, ""I Love you"", would produce: I said, "I Love you".


    Hi Fred,

    After using CHR$(34) for a long time (PBDOS) for imbedding quotes
    I opted to Dimension the variable "Q" as a string and list it as
    a global variable in a PUBLIC starement (so units/libs can use).

    Then PRINT Q;"Hello there";Q

    An even greater benefit is that if I want to shell to DOS and use
    long file names, I can concatenate the Q variable with my path:

    DIM Q AS STRING 'give it a name
    PUBLIC Q 'for units/libs
    Q = CHR$(34) 'set the string

    Qpath$ = Q + "C:\My directory\afile.txt" + Q 'embed quotes
    SHELL "if exist " + Qpath$ + " echo it's there" 'use in command

    This allows you to create LFN files and directories from PBDOS.
    Only real advantage over CHR$(34) is brevity & readability.

    ------------------


    [This message has been edited by Leon Stennett (edited August 04, 2002).]

    Leave a comment:


  • Tom Hanlin
    replied
    Fred, your code works fine in the Windows compilers, although there
    should be three quotes on the end. PB/DOS, hmmm...

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Leave a comment:


  • Egbert Zijlema
    replied
    Originally posted by Fred Katzel:
    Hi
    Is there some way to put quote marks in PRINT statements.
    What about CHR$(34)?
    Code:
    PRINT CHR$(34);"I love you";CHR$(34)
    Another option maybe to use WRITE instead of PRINT.



    ------------------
    mailto:[email protected][email protected]</A>
    http://zijlema.basicguru.com

    Leave a comment:


  • Fred Katzel
    started a topic Quote marks in PRINT statements

    Quote marks in PRINT statements

    Hi
    Is there some way to put quote marks in PRINT statements. When I
    programmed in PLI or FORTRAN by putting "" in a PRINT statement
    would put quote marks in the OUTPUT statement. ei:
    PRINT "I said, ""I Love you"", would produce: I said, "I Love you".


    ------------------
Working...
X