• Lucid Dreaming - Dream Views




    Results 1 to 3 of 3
    1. #1
      Emotionally unsatisfied. Sandform's Avatar
      Join Date
      Jul 2007
      Gender
      Location
      Texas
      Posts
      4,298
      Likes
      24

      Qbasic - someone help me.

      Hi guys.

      Just to make this really simple.

      In numeric values drawn from the LET function by using the PRINT function.

      EX:

      COLOR 15, 3
      CLS
      LET length1 = 25
      PRINT "The length of the pool is"; length1; "."
      END



      It comes out as "The length of the pool is 25 ."

      There is a space before and after 25, I'm not sure why there is one after, but the reason there is one before is to make room for the negative sign.

      I obviously can rewrite it so that it looks like

      PRINT "The length of the pool is"; length1; "feet."

      To make it look appropriate, but what about when I want to end the sentence with a number, or worse a monetary value?

      Does anyone know how I can fix this?

    2. #2
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Because it converts it to a string before inserting it in the terminal. You need to convert it yourself and then trim it.

      ? "The length of the pool is" + $ltrim($rtrim($STR(length1))) + "feet."

      FYI, you don't need the LET command.

      length1 = 25 is fine.

    3. #3
      Emotionally unsatisfied. Sandform's Avatar
      Join Date
      Jul 2007
      Gender
      Location
      Texas
      Posts
      4,298
      Likes
      24
      Quote Originally Posted by ninja9578 View Post
      Because it converts it to a string before inserting it in the terminal. You need to convert it yourself and then trim it.

      ? "The length of the pool is" + $ltrim($rtrim($STR(length1))) + "feet."

      FYI, you don't need the LET command.

      length1 = 25 is fine.
      Thank you Ninja =).

    Bookmarks

    Posting Permissions

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