1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BDEBUGGER - minor issue

Discussion in 'Support' started by Steve Fabian, Aug 11, 2010.

  1. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    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
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    I can't imagine *why* you would want to name your aliases and variables the
    same, but regardless ...


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


    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
     
  3. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    | ---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
     

Share This Page