Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set(_SET_PRINTFILE,"LPT1") - Error TERM/2014 Create error: LPT1 (DOS Error 2) #360

Open
Eduardo-DNI opened this issue Oct 9, 2024 · 1 comment

Comments

@Eduardo-DNI
Copy link

Eduardo-DNI commented Oct 9, 2024

Hello!
I compiled some example code from the Guide for CA_Clipper in Harbor and found an error.

When saved, the current value of _SET_PRINTFILE has the value LPT1.

When will you rewrite the old value.....

SET(nCurrent, aNewSets[nCurrent])

in _SET_PRINTFILE the error occurs:

Error TERM/2014 Create error: LPT1 (DOS Error 2)

If the same code is compiled in Clipper5.2 _SET_PRINTFILE has no prior value. No execution error occurring.

Code:

#include "set.ch"

Main()

FUNCTION Main()

   LOCAL aSets[ _SET_COUNT ]

   CLS
   ?"Starting..."

   aSets := SetAll()
   SetAll( aSets )

   ?"Finished!"

   Return( Nil )

FUNCTION SetAll( aNewSets )

   LOCAL aCurrentSets[ _SET_COUNT ], nCurrent

   IF ( aNewSets != NIL ) // Set new and return current
      FOR nCurrent := 1 TO _SET_COUNT
         aCurrentSets[ nCurrent ] := ;
            Set( nCurrent, aNewSets[ nCurrent ] )
      NEXT
   ELSE
      FOR nCurrent := 1 TO _SET_COUNT
         aCurrentSets[ nCurrent ] := Set( nCurrent )
      NEXT
   ENDIF

   RETURN ( aCurrentSets )
@alcz
Copy link
Contributor

alcz commented Dec 4, 2024

Some notes:
Here Clipper 5.3 also has unpopulated defult value for Set( _SET_PRINTFILE ).
In Harbour you can set empty value with Set( _SET_PRINTFILE, " " ) but not with Set( _SET_PRINTFILE, "" ) - the latter is ignored
In Harbour Playground the error is
Error TERM/2014 Create error: |lpr
(DOS Error 38) (Quit, Retry, Default)
Summary: default value of _SET_PRINTFILE is unverified for the system, but i think it's still better default than keeping empty value that will not ever print.
If the submitted example code can be a real life problem? If you save SET's to a file and read them on next application start, you need to verify this setting...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants