Welcome!

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

SignUp Now!

BDEBUGGER - minor issue

May
3,515
5
Environment variables:
usrdsk="C:\Documents and Settings\ESF\desktop"
windsk="C:\Documents and Settings\All Users\desktop"

Aliases:
usrdsk=cdd/n %usrdsk
windsk=cdd/n %windsk

In a batch file I was debugging I have the command:
do dr in /l windsk usrdsk

When I use the variable view window to display DR in the loop, the value
shown is the expanded alias, not the expanded variable. This seems to happen
only for the value display, because the batch line containing "pushd %[%dr]"
is executed correctly, the debugger helped me find my file naming mistakes
resulting in odd but correct display by the batch file.
--
Steve
 
> Environment variables:
> usrdsk="C:\Documents and Settings\ESF\desktop"
> windsk="C:\Documents and Settings\All Users\desktop"
>
> Aliases:
> usrdsk=cdd/n %usrdsk
> windsk=cdd/n %windsk

I can't imagine *why* you would want to name your aliases and variables the
same, but regardless ...


> In a batch file I was debugging I have the command:
> do dr in /l windsk usrdsk

Without the body of your DO loop I cannot even begin to guess at what you're
seeing.


> When I use the variable view window to display DR in the loop, the
> value shown is the expanded alias, not the expanded variable.

There is no such thing as a "variable view window" -- are you talking about
the Watch List? Or the Evaluate Expression dialog? Or maybe the
Environment window?

Rex Conn
JP Software
 
| ---Quote---
|| In a batch file I was debugging I have the command:
|| do dr in /l windsk usrdsk
| ---End Quote---
| Without the body of your DO loop I cannot even begin to guess at
| what you're seeing.
|
| ---Quote---
|| When I use the variable view window to display DR in the loop, the
|| value shown is the expanded alias, not the expanded variable.
| ---End Quote---
| There is no such thing as a "variable view window" -- are you
| talking about the Watch List? Or the Evaluate Expression dialog?
| Or maybe the Environment window?

Sorry, I meant the "watch list". The code is part of a GOSUB without command
line parameters:

do dr in /l windsk usrdsk
pushd %[%dr]
set link=%@expand["* %z.lnk"]
iff defined link then
set used=y
switch %rpt
case SC
shortcut "%@full[%link]"
equals
case HK
echo %@unquote[%@format[35,%link]] %@format[-3,%hk] %dr
endswitch
endiff
popd
enddo

The only command in the fragment that is aliased is EQUALS which uses
ECHO to print a line of equal signs (as a separator).
I put DR in the watch list (Debug -> Add Watch) before entering the DO.
When it became defined (stepping into the DO command) the watch list
displayed the expansion of the alias WINDSK (and later of USRDSK), instead
of the value of e.v. DR, i.e., the string windsk (or usrdsk). However, the
PUSHD command received the correct value, and the batch program worked as
intended. The real problem had been in the filenames located by @expand[].
--
Steve
 
Back
Top
[FOX] Ultimate Translator
Translate