Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@errtext issue

May
603
0
TCC 9.02.151 Windows XP [Version 5.1.2600]
TCC Build 151 Windows XP Build 2600 Service Pack 3

Why does @errtext change when I've echoed %? before using it? It only
appears to happen with [0]

D:\>echo ?? %@errtext[0]
?? The handle is invalid.

D:\>echo %? %@errtext[0]
0 The system could not find the environment option that was entered.

--
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
Measure wealth by the things you have for which you would not take money.
 
Jim Cook wrote:

> TCC 9.02.151 Windows XP [Version 5.1.2600]
> TCC Build 151 Windows XP Build 2600 Service Pack 3
>
> Why does @errtext change when I've echoed %? before using it? It only
> appears to happen with [0]
>
> D:\>echo ?? %@errtext[0]
> ?? The handle is invalid.
>
> D:\>echo %? %@errtext[0]
> 0 The system could not find the environment option that was entered.

@errtext[0] returns the last system error -- which in the second case
was a failure to find "?" in the environment. (Environment variables
override internal variables, so the parser had to see if you had an
environment variable named "?".) You'd get the same result with:

echo %wockawocka %@errtext[0]

Rex Conn
JP Software
 

Similar threads

Back
Top