Home Forums HTBasic Forum HTBasic Printer Error

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #9203
    Troy Pulk

      Hello I’m Troy,

      I do not know HTBasic our guy that does retired and now when we need him he is not here.

      I’m using HTBasic 8.3 on Win 7 SP1

      This all worked last week and then we had an IT scan and now this doesn’t work.

      The Printer is on a local network HUB.

      If I send the document straight to the printer it prints, just not through HTBasic.

      So here is the problem:

      This HTBasic program is just for printing and water temp. So I create a document and print it by sending it the print spooler and the HTBasic sends it to the printer but then it times out with this error:

      Error 11167 in 1280, I then go into the code,

      Line 1270 is DISP “sending Graphics to “&Printer$

      Line 1280 is output 26 using “K,#”;CHR$(27)&”%0B” ! Enter HPGL Mode

      What does this mean? and what is error 11167?

      Here is the whole section

      1150 Print_file: !
      ON ERROR GOSUB Ercheck
      ! COPY Filename$ TO “C:\Temp\HPGL_Plot” ! Much Faster This Way (using RAM disk)
      COPY Filename$ TO “C:\Temp\”&Filename$ ! Much Faster This Way (using RAM disk)
      ! Open HPGL File for Printing
      ! ASSIGN @Tp TO “C:\Temp\HPGL_Plot”;FORMAT ON
      ASSIGN @Tp TO “C:\Temp\”&Filename$;FORMAT ON
      DISP “Currently Printing: “&Filename$&”… “;
      ON TIMEOUT 26,2 GOTO No_printer
      ON END @Tp GOTO 1380
      IF Filename$[1,1]=”L” THEN
      DISP “Sending Text to “&Printer$
      DISP “Sending Graphics to “&Printer$
      OUTPUT 26 USING “K,#”;CHR$(27)&”%0B” ! Enter HPGL Mode.
      END IF
      ENTER @Tp USING “K”;Plot$ ! Get HPGL Commands from File
      IF Filename$[1,1]=”L” THEN
      OUTPUT 26 USING “K”;Plot$ ! and send them to the printer
      OUTPUT 26 USING “#,K”;Plot$ ! # TO Suppress CR and LF
      END IF
      END LOOP
      ASSIGN @Tp TO *
      OUTPUT 26 USING “K,#”;CHR$(27)&”%1A” ! Enter PCL Mode.
      OUTPUT 26 USING “K”;CHR$(27)&”E” ! Reset to Eject Page
      CONTROL 26,111;1

      File_found=0 ! Reset for next search
      PURGE “C:\Temp\”&Filename$ ! Much Faster This Way (using RAM disk)
      1430 RETURN



        Error numbers above 10000 are passed through from Windows (they are not specific HTBasic error codes). It is likely a permissions error caused by change in ownership of a file, folder, or in this case printer. You said this happened after IT scan. Not sure what was involved in this, but probably related to your login permissions and being assigned as new account owner after departure of your retired guy. So it’s an IT issue. Line 1280 OUTPUT 26 USING “K,#”;CHR$(27)&”%0B” ! Enter HPGL Mode, is simply trying to send an escape sequence to the printer assigned to ISC (Interface Select Code) 26 to set it to HPGL mode as the comment indicates.

        (See https://support.microsoft.com/en-us/topic/-access-denied-or-other-errors-when-you-access-or-work-with-files-and-folders-in-windows-219af563-1953-ab4a-f17e-b0182755214e)

        Troy Pulk

          Thanks Ralph,

          It’s probably not in the permissions because we have full system wide admin rights with one PW and there are only two accounts Admin and xadmin.

          I’ll still check though.

          The file goes into the print spooler then gets copied into 00Printed, HTBasic uses Printshop Pro 7 to create the file and sends it to the printer.

          How do I check to see if HTBasic even sees the printer on the network?



            There are two ways to set or view the current printer. One is to invoke the Device Setup dialog in the Tools menu. You can then select WIN-PRINT in the driver list and then click on Properties. This will pop up the Windows Configure Print Driver dialog box and allow you to see the current printer and select another printer if needed. Note the “Network” button at the bottom of this pop-up box will allow you to select or enter a network printer name.

            The second way allows you to invoke the same Windows Configure Print Driver dialog box but under program control by executing the following line of HTBasic code:

            CONTROL 10,102;1

            Also, I thought I included this before, but Windows System Error 1167 can be found on this page:

            1167 (0x48F)
            The device is not connected.

            Troy Pulk

              Thanks again,

              I’ll check that out right away.

              Troy Pulk


                There is nothing in the network after clicking the button.

                Also, my code says the ICS is 26 but when I try to set up a new printer or modify this one there is no 26 it goes from 25 to 27.
                The set up uses 10 automatically but there is no 10 in the code.

                If I change all the 26’s to 10 it only prints one line of letters and numbers.

                Also, CONTROL 10,102;1 does not work. I’ve tried different ones like 26,111;1 10,111;1 26,102;1 to no avail.

                It also says “sending graphics to HPGL color printer” then it times out.

                Can you look at my code above and see if there is another way to writie it?

                Since 26 is not working is there a way to see which ICS is working?

                Thanks for our help

                Troy Pulk

                  Thanks for your help Ralph,

                  I found the problem, the printer port settings got changed and the pooling setting was unchecked.

                  So, I checked the pooling box and added LPT1 with my printer on it and now the HTBasic printing program works as it did before.

                  Thanks for helping me.

                  Good day to you.


                    Great news! Glad you got it working.

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.
                  Scroll to Top
                  HTB icon

                  Please Sign In