|
Yes. And, because you are using "pass by
reference (or name)", it will work even if Params does not exist. I just
wanted to make sure you that you were not trying to set up Params as multiple
parameters like: SET Paramas="arg1,arg2,arg3". That would require a
different approach.
----- Original Message -----
Sent: Thursday, November 11, 2004 11:44
AM
Subject: Re: [Hardhats-members] More M
syntax questions
Maury,
Thanks for your answer. In my code, Params is an array with
multiple possible entries. Will your code still work?
Thanks
You
may think it's ugly, but because M does not support _expression_ indirection,
you have to use the following form:
set
@("OKToCont=$$"_Cmd_"(.Params)")
This assumes that Params is just a
name and not a string of multiple parameters.
M/Mumps supports three
types of indirection: name, argument, and pattern. In a SET command, the
argument is the left side, the equal sign and the right
side.
----- Original Message ----- From: "Kevin
Toppenberg" <[EMAIL PROTECTED]> To: "Hardhats Sourceforge"
<[EMAIL PROTECTED]> Sent: Sunday, November 07, 2004
6:46 AM Subject: [Hardhats-members] More M syntax
questions
> A quick question before I head off for my
trip: > > I want to have a table that contains procedure
names, > like this: > > new ProcTable > set
ProcTable(cRemark)="DoComment" > set ProcTable(cShow)="DoShow" >
set ProcTable(cM)="DoM" > set ProcTable(cMenu)="DoMenu" > set
ProcTable(cUpload)="DoUpload" > set ProcTable(cJump)="DoJump" >
set ProcTable(cLookup)="DoLookup" > set
ProcTable(cMsgBox)="DoMsgBox" > set
ProcTable(cValueLookup)="DoValueLookup" > set
ProcTable(cFileUtility)="DoFileUtility" > > (I think this will
be neater than the sequential IF's > I am using now) > >
I want to call the correct procedure based on a > command, like
this: > > if $data(ProcTable(Command)) do > . new Cmd set
Cmd=ProcTable(Command) > . set [EMAIL PROTECTED]@(.Params) > goto
CMDQuit > > Only its not working. I have tried this several
ways, > with the following errors: > > set
[EMAIL PROTECTED]@(.Params) > --> compiler error > >
set [EMAIL PROTECTED]@(Params) > --> compiles ok, but crashes
here > > set [EMAIL PROTECTED](Params) > --> compiles
ok, but crashes here > > I'm not sure when to use @Cmd vs @Cmd@
I've seen both > patterns. > > Can someone tell me what
I am doing wrong? > > Thanks > Kevin > >
> > > > > >
__________________________________ > Do you Yahoo!? > Check
out the new Yahoo! Front Page. > www.yahoo.com > >
> > >
------------------------------------------------------- > This SF.Net
email is sponsored by: > Sybase ASE Linux Express Edition - download
now for FREE > LinuxWorld Reader's Choice Award Winner for best
database on Linux. >
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click >
_______________________________________________ > Hardhats-members
mailing list > [EMAIL PROTECTED] >
https://lists.sourceforge.net/lists/listinfo/hardhats-members >
------------------------------------------------------- This
SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download
now for FREE LinuxWorld Reader's Choice Award Winner for best database on
Linux. http://ads.osdn.com/?ad_idU88&alloc_id065&op=click _______________________________________________ Hardhats-members
mailing
list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hardhats-members
Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com
|