#54 ZB fails with indirection and parameters

Jiri Kulhan


it looks that ZB command fails when the entryref is
specified by indirection and some command or count
number parameter is given.

See the example:

GTM>w $zv
GT.M V4.4-004 Linux x86
GTM>zb ^DIR:"w $zpos"

GTM>zb ^DIR::2

GTM>s X="^DIR"
GTM>zb @X
GTM>zb @X::2
%GTM-E-NOPLACE, Line specified in a ZBREAK cannot be found

GTM>zb @X:"W $zpos"
%GTM-E-NOPLACE, Line specified in a ZBREAK cannot be found

Let me know if you need some more info.



  • Steven Estes

    Steven Estes - 2004-04-29

    Logged In: YES


    This is due to a common misperception of indirection and GTM
    not giving a proper error for the condition so it can be
    recognized correctly.

    There are two types of indirection: simple name level
    indirection where the substitution is a variable, label or
    routine name and expression indirection where the
    substitution is anything more than that up to and including
    complex expressions. Generally speaking, when you use
    indirection in an argument to a command and the argument is
    composed of anything else besides that indirection (e.g.
    @a+1 or @x::2 in your example) you are restricted to name
    level indirection. Note that name level indirection CANNOT
    have "^" characters in it. Those must appear outside the
    indirection. If the argument is solely composed of the
    indirection, then the indirection can be an expression
    indirection and can be as complex as you want it to.

    So what happened above? When you did "zb @X", it took this
    to be expression (complex) indirection and correctly
    evaluated X to be ^DIR. When you did "zb @X::2", it took
    this to be name level indirection. Since there was no "^"
    specified in the command line, it assumed it was looking for a
    local label and looked for the LOCAL LABEL "^DIR" which was
    not found and then gave you the odd message.

    The correct syntax for your example because it uses name
    level indirection is:

    s X="DIR"
    zb ^@X::2

    We have a problem open to correct this and it will be fixed in
    a future release but it is fairly low priority.. :-). Let us know if
    this works out for you..


  • Jiri Kulhan

    Jiri Kulhan - 2004-04-29

    Logged In: YES

    Hi Steve,

    thanks for your explanation. The error message is a bit
    misleading, but it works fine.

    Thanks again,



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks