Skip to content

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

Open
@Eduardo-DNI

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 )

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