CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 1999
    Posts
    37

    I really am a newbie ;(



    Hey guys and gals... just wondering if you know how I can make a newline when printing data. I know in C/C++ it's ENDL or "\n", but how do I do this with Visual Basic?


    Thanks

  2. #2
    Join Date
    Apr 1999
    Posts
    5

    Re: I really am a newbie ;(



    Hi,


    dim EndOfLine as string


    EndOfLine = chr(13) & chr(10) ' = \n


    'if you want to print something like

    'Hello\nWorld


    debug.print "Hello" & EndOfLine & "World"


    bye


    __Neph__




  3. #3
    Join Date
    Mar 1999
    Posts
    37

    Re: I really am a newbie ;(



    Thanx, except that has problems in VB5... I figured it out myself just a few min ago... you gotta use the built in VB control vbcrlf


    peace

  4. #4
    Join Date
    Mar 1999
    Location
    Roswell, GA
    Posts
    73

    Re: I really am a newbie ;(



    hey Alex use these...


    Constant Equivalent Description

    vbCrLf Chr(13) + Chr(10) Carriage return–linefeed combination

    vbCr Chr(13) Carriage return character

    vbLf Chr(10) Linefeed character

    vbNewLine Chr(13) + Chr(10) or Chr(13) Platform-specific new line character; whichever is appropriate for current platform

    vbNullChar Chr(0) Character having value 0

    vbNullString String having value 0 Not the same as a zero-length string (""); used for calling external procedures

    vbTab Chr(9) Tab character

    vbBack Chr(8) Backspace character

    vbFormFeed Chr(12) Not useful in Microsoft Windows

    vbVerticalTab Chr(11) Not useful in Microsoft Windows


    so put in a vbCrLf instead of chr(13) + chr(10)... VB will replace the constant at runtime (compile-time) but it makes the code MUCH more readable !


    phil


    ps check out the 'constants' section under help... it will open your eyes to a lot of things you can do in VB

  5. #5
    Join Date
    Mar 1999
    Location
    Roswell, GA
    Posts
    73

    Re: I really am a newbie ;(



    hey Alex use these...


    Constant Equivalent Description

    vbCrLf Chr(13) + Chr(10) Carriage return–linefeed combination

    vbCr Chr(13) Carriage return character

    vbLf Chr(10) Linefeed character

    vbNewLine Chr(13) + Chr(10) or Chr(13) Platform-specific new line character; whichever is appropriate for current platform

    vbNullChar Chr(0) Character having value 0

    vbNullString String having value 0 Not the same as a zero-length string (""); used for calling external procedures

    vbTab Chr(9) Tab character

    vbBack Chr(8) Backspace character

    vbFormFeed Chr(12) Not useful in Microsoft Windows

    vbVerticalTab Chr(11) Not useful in Microsoft Windows


    so put in a vbCrLf instead of chr(13) + chr(10)... VB will replace the constant at runtime (compile-time) but it makes the code MUCH more readable !


    phil


    ps check out the 'constants' section under help... it will open your eyes to a lot of things you can do in VB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured