Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#47 $data of local array gets 0 instead of error

open
nobody
None
5
2012-12-29
2003-10-21
Alain Descamps
No

Consider following :

GTM>v "NOLVNULLSUBS"

GTM>s a("")=22
%GTM-E-LVNULLSUBS, Null subscripts not allowed in
local variables

GTM>w $d(a(""))
0

I have 2 remarks on this :

1. null subscripts are per default allowed in a GT.M
system, which is not Ansi-95, as far as i know. Is it
possible to change this default behavior ?

2. The $d function should give an error. This is in my
opinion a bug.

Greetings,

Alain

Discussion

  • Logged In: YES
    user_id=97919

    Hi Alain,

    1) Since allowing null subscripts has been default in GT.M for
    quite a while now, changing this behaviour does not seem
    likely particularly since Ansi-95 compliance is easily obtained
    by the VIEW "NOLVNULLSUBS" command.

    2) You are right that the $DATA function should give an
    error. We have noticed that it does give an error for global
    variables but not for local variables. We have created a
    change-request for this. Tracking number is D9D10-002376.

    Thanks,
    Narayanan.