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)
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]
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)