harbour / core

Portable, xBase compatible programming language and environment
https://harbour.github.io/
Other
324 stars 207 forks source link

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

Open Eduardo-DNI opened 1 month ago

Eduardo-DNI commented 1 month ago

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)