The QBasic / QB64 Discussion Forum      Other Subforums, Links and Downloads
 
Respond to this messageReturn to Index
Original Message
  • Re: HP LaserJet Print Program
    • (Login MCalkins)
      R
      Posted May 3, 2012 2:10 AM

      I can't edit or delete posts in this subforum. Pete or Solitaire would have to do it.

      As it seems you've figured out, you need to use NBSP (Alt+255 or Alt+0160). You can do use notepad to search and replace spaces with NBSP characters, or use a program like this:

      'public domain, michael calkins
      DIM i AS LONG
      DIM b AS STRING * 1
      DIM t AS STRING
      LINE INPUT t
      IF t = "" THEN t = "delme.bas"
      OPEN t FOR INPUT AS 1
      CLOSE
      OPEN t FOR BINARY AS 1
      OPEN "---tmp.txt" FOR OUTPUT AS 2
      CLOSE 2
      OPEN "---tmp.txt" FOR BINARY AS 2
      FOR i = 1 TO LOF(1)
      GET 1, , b
      IF ASC(b) = &H20 THEN b = CHR$(&HA0)
      PUT 2, , b
      NEXT i
      CLOSE
      SHELL "notepad ---tmp.txt"
      SYSTEM

      Regards,
      Michael
    Login Status
  • You are not logged in
    • Login
      Password
       

      Optional
      Provides additional benefits such as notifications, signatures, and user authentication.


      Create Account
    Your Name
    Your Email
    (Optional)
    Message Title
    Message Text
    Options Also send responses to my email address
          


    Newbies usually go to www.qbasic.com and click on The QBasic Forum
    Forum regulars have their own ways, which include The QBasic Community Forums