Announcement

Collapse
No announcement yet.

Illegal Operation

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

  • Illegal Operation

    Can someone tell me why windows98 would issue the error
    "illegal operation Performed" when running the attached program?
    It compiles just fine....But will not run....Question- WHY???
    $compile Exe
    filin$ = command$
    filein$ = mid$(filin$,1,8)
    open filein$ for input as #1
    open "lpt1" for output as #2
    do while not eof(1)
    line input #1, dta$
    print #2, dta$
    loop
    END


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

  • #2
    I tried it on my system and it works okay. However, I did have
    to change PRINT #2,DTA$ to PRINT;DTA$ since I have a USB printer
    attached and nothing to LPT1.

    Do you know which line it's going burp on? If not, let's assume
    it's the line I had to change. Make sure your printer is on, paper
    loaded and it's on-line and ready to go.

    On a personal note: Although it will work, I would not recommend
    using DTA$ as a variable. That label is used in other aspects of
    programming and the programmer may become confused.


    ------------------
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      LPT1 (without the colon) uses the BIOS to do the I/O, rather than PowerBASIC's own LPT handler.

      However, there are a few things you can try:

      1. Add $ERROR ALL ON to the code.

      2. Add code to verify the filename exists before opening the file.

      Beyond this, it could be almost anything. ie, no LPT1 port defined, or not captured. The O/S could be unstable (ie, do a reboot and retest), or something else, such as a TSR or another application could be causing problems.

      Did you try the compiled code on more than one PC? Try compiling on more than one PC?

      Finally, if your copy of PB.EXE is dated earlier than 19-12-97 (dd/mm/yy) then you should send an email to mailto:[email protected][email protected]</A> (with your serial number!) and request an update to that edition.

      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        My PBDOS 3.5 is dated 16 Dec 97.



        [This message has been edited by Mark Hunter (edited January 13, 2002).]
        Algorithms - interesting mathematical techniques with program code included.

        Comment


        • #5
          Originally posted by Mel Bishop:
          I tried it on my system and it works okay. However, I did have
          to change PRINT #2,DTA$ to PRINT;DTA$ since I have a USB printer
          attached and nothing to LPT1.
          I take it that means one can print to a USB printer from PBdos ?
          Damn, I must be behind the times



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

          Comment


          • #6
            Neil: No, Mel means he disabled printing completely, in order to test the rest of the code.

            Mark: Yes, you are 3 builds behind the current release.

            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment

            Working...
            X