Visitar URL original
Set(_SET_PRINTFILE,"LPT1") - Error TERM/2014 Create error: LPT1 (DOS Error 2) · Issue #360 · harbour/core · GitHub
Skip to content

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

Open

Description

@Eduardo-DNI

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 )

Activity

  1. alcz commented on Dec 4, 2024

    @alcz
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions