Actually, I think you're perfectly safe using "FDA" as a name for your
FDA array, since all references are through indirection of a DI*
subscripted array.

Namespaces pose an especially difficult problem when variables are
passed by *reference*, and less so when the array name is passed as a
value parameter (I'm tempted to call this passing the parameter by
name, because it isn't too much of a stretch to think of the
indirection as using a thunk, but I digress). 

At any rate, the problem occurs when name of the formal parameter
collides with a variable in the calling symbol table, so it seems to me
that a more sensible rule to namespace formal parameters (though this
doesn't help much with intrapackage calls!) This is a nasty problem,
and something else I'd like to see changed in MUMPS. There really is no
reason why this problem could not solved in such a way that name
collisions are impossible. And yes, I do think cleaning up these
"glitches" would go a long way towards increasing the appeal of MUMPS.

--- Kevin Toppenberg <[EMAIL PROTECTED]> wrote:

> 
> I guess I'll have to believe you on this one.  When I
> fixed my code to make the placemarkers appear in
> serial order it started working.  After your post
> below, I tried to go back and reproduce the error and
> then work towards your solution.  But now the error
> won't occur!  Here is my log (which is exactly like
> the one that failed in my earlier post--see way down
> below)
> 
> GTM>d DT^DICRW
> GTM>set FDA(200,"+999,",.01)="USER,TEST01"
> GTM>set DIC(0)=""
> GTM>do UPDATE^DIE("E","FDA","ZZIEN","ZZMSG")
> GTM>zwr ZZIEN
> ZZIEN(999)=100
> GTM>zwr ZZMSG
> %GTM-E-UNDEF, Undefined local variable: ZZMSG
> 
> Never-the-less, I have modified my code to namespace
> my variables as you mentioned.  I read that
> Programming Standards guide, but I apparently didn't
> retain that important fact.
> 
> Thanks again.
> Kevin
> 
> 
> --- steven mcphelan <[EMAIL PROTECTED]> wrote:
> 
> > The problem you are having is because you are using
> > the FDA array as your
> > input to Fileman.  The VA Programming Standards
> > required that if you pass
> > data to another API outside your assigned namespace,
> > you must namespace your
> > input variables to avoid the very clashes you are
> > seeing.  If you do not
> > have an assigned namespace then you can use the ZZ
> > namespace.  Try the same
> > thing with ZZFDA() instead of FDA.
> > 
> > As I knew, the place holders in calling Fileman APIs
> > do not need to be
> > sequential.  They are just that, a string in a
> > certain syntax to represent
> > an internal record number.  The number you pass is
> > important when evaluating
> > the return array from the FM API that contains the
> > actual internal record
> > numbers created for those place holders.
> > 
> > Here are two examples.  One just adds a NEW PERSON. 
> > The second adds a NEW
> > PERSON and also adds a new entry to a multiple in
> > file 200.
> > 
> > VAH>S DIC(0)="",VFD(200,"+5,",.01)="DOE,JANE"
> > 
> > VAH>K ZZERR,ZZIEN,DIERR,VFD
> > 
> > VAH>S DIC(0)="",VFD(200,"+5,",.01)="DOE,JANE"
> > 
> > VAH>D UPDATE^DIE("E","VFD","ZZIEN","ZZERR") W ! ZW
> > ZZERR,ZZIEN
> > 
> > ZZIEN(5)=2
> > 
> > VAH>D ^%G
> > 
> > Device:      Right margin: 80=>
> > 
> > Global ^VA(200,2
> > ^VA(200,2,0)=DOE,JANE
> >           1)=^^^^^^3041213^10000000033
> >         3.1)=1951
> >          20)=^JANE DOE
> > 
> >
>
---------------------------------------------------------------------------
> > VAH>S DIC(0)="",VFD(200,"+3,",.01)="DOE,JANE"
> > 
> > VAH>S VFD(200.005,"+97,+3,",.01)="USERDOE"
> > 
> > VAH>D UPDATE^DIE("E","VFD","ZZIEN","ZZERR") W ! ZW
> > ZZERR,ZZIEN
> > 
> > ZZIEN(3)=2
> > ZZIEN(97)=1
> > 
> > VAH>D ^%G
> > 
> > Device:      Right margin: 80=>
> > 
> > Global ^VA(200,2
> > ^VA(200,2,0)=DOE,JANE
> >           1)=^^^^^^3041213^10000000033
> >         3.1)=1951
> >          20)=^JANE DOE
> > ^VA(200,2,500,0)=^200.005A^1^1
> > ^VA(200,2,500,1,0)=USERDOE
> > ^VA(200,2,500,"B","USERDOE",1)=
> > 
> > 
> > 
> > 
> > ----- Original Message ----- 
> > From: "Kevin Toppenberg" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, December 12, 2004 1:22 PM
> > Subject: Re: [Hardhats-members] Mysterious DIERR
> > message
> > 
> > 
> > > Oops, "?2?  should have been "?2"  KT
> > >
> > > --- Kevin Toppenberg <[EMAIL PROTECTED]> wrote:
> > >
> > > > Well, I have gotten the process working.  I'll
> > post
> > > > here to give some conclusion in case someone
> > reads
> > > > this later.
> > > >
> > > > The placemarkers "?+1" or "?2? etc. DO have to
> > be
> > > > used
> > > > in sequential order.  At least starting out with
> > "2"
> > > > caused an error.  This is different from what I
> > (and
> > > > I
> > > > think most others) previously thought.
> > > >
> > > > Thanks all
> > > > Kevin
> > > >
> > > > --- Kevin Toppenberg <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > Steven,
> > > > >
> > > > > I don't have Cache', so I can't try out the
> > latest
> > > > > Cache.dat.
> > > > >
> > > > > It appears that in the code set that I have,
> > there
> > > > > IS
> > > > > a difference between "+1," and "+999,".  Below
> > is
> > > > a
> > > > > screen log where the latter fails, while the
> > > > former
> > > > > succeeds.
> > > > >
> > > > > I haven't tried this with and without the S
> > > > > DIC(0)=""
> > > > > yet.
> > > > >
> > > > > What does the DT^DICRW do?  It doesn't set up
> > the
> > > > > environment, because I tried it upon first
> > > > entering
> > > > > GTM and UPDATE^DIE crashed.  I then did D
> > ^XUP,
> > > > > exited, and did the UPDATE and it worked fine.
> > > > >
> > > > > Thanks greatly for working with me on this.
> > > > >
> > > > > Kevin
> > > > >
> > > > >
> > > > > GTM>D DT^DICRW
> > > > > GTM>S FDA(200,"+999,",.01)="DOE,JANE"
> > > > > GTM>SET DIC(0)=""
> > > > > GTM>DO UPDATE^DIE("E","FDA","ZZIEN","ZZMSG")
> > > > >
> > > > > GTM>ZWR ZZIEN
> > > > > %GTM-E-UNDEF, Undefined local variable: ZZIEN
> > > > >
> > > > > GTM>ZWR ZZMSG
> > > > > ZZMSG("DIERR")="3^3"
> > > > > ZZMSG("DIERR",1)=744
> > > > > ZZMSG("DIERR",1,"PARAM",0)=3
> > > > > ZZMSG("DIERR",1,"PARAM","FIELD")=.01
> > > > > ZZMSG("DIERR",1,"PARAM","FILE")=20
> > > > > ZZMSG("DIERR",1,"PARAM","IENS")="?+1,"
> > > > > ZZMSG("DIERR",1,"TEXT",1)="Field FILE is part
> > of
> > > > Key
> > > > > 'A', but the field has not been assigned a
> > value."
> > > > > ZZMSG("DIERR",2)=744
> > > > > ZZMSG("DIERR",2,"PARAM",0)=3
> > > > > ZZMSG("DIERR",2,"PARAM","FIELD")=.02
> > > > > ZZMSG("DIERR",2,"PARAM","FILE")=20
> > > > > ZZMSG("DIERR",2,"PARAM","IENS")="?+1,"
> > > > > ZZMSG("DIERR",2,"TEXT",1)="Field FIELD is part
> > of
> > > > > Key
> > > > > 'A', but the field has not been assigned a
> > value."
> > > > > ZZMSG("DIERR",3)=744
> > > > > ZZMSG("DIERR",3,"PARAM",0)=3
> > > > > ZZMSG("DIERR",3,"PARAM","FIELD")=.03
> > > > > ZZMSG("DIERR",3,"PARAM","FILE")=20
> > > > > ZZMSG("DIERR",3,"PARAM","IENS")="?+1,"
> > > > > ZZMSG("DIERR",3,"TEXT",1)="Field IENS is part
> > of
> > > > Key
> > > > > 'A', but the field has not been assigned a
> > value."
> > > > > ZZMSG("DIERR","E",744,1)=""
> > > > > ZZMSG("DIERR","E",744,2)=""
> > > > > ZZMSG("DIERR","E",744,3)=""
> > > > >
> > > > > ... Second Try ...
> > > > >
> > > > >
> > > > > GTM>K FDA
> > > > > GTM>K ZZMSG
> > > > >
> > > > > GTM>SET FDA(200,"+1,",.01)="DOE,JANE"
> > > > > GTM>ZWR FDA
> > > > > FDA(200,"+1,",.01)="DOE,JANE"
> > > > >
> > > > > GTM>DO UPDATE^DIE("E","FDA","ZZIEN","ZZMSG")
> > > > > GTM>ZWR ZZMSG
> > > > > %GTM-E-UNDEF, Undefined local variable: ZZMSG
> > > > > GTM>ZWR ZZIEN
> > > > > ZZIEN(1)=32
> > > > >
> > 
> === message truncated ===
> 
> 
> 
>               
> __________________________________ 
> Do you Yahoo!? 
> Jazz up your holiday email with celebrity designs. Learn more. 
> http://celebrity.mail.yahoo.com
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real
> users.
> Discover which products truly live up to the hype. Start reading now.
> 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Hardhats-members mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hardhats-members
> 


=====
A practical man is a man who practices the errors of his forefathers. 
--Benjamin Disraeli
====
Greg Woodhouse 
[EMAIL PROTECTED] 
[EMAIL PROTECTED] 





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Hardhats-members mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to