Thanks for your replies.

Let me write a bit more.  It helps me clarify my
problem to myself (and hopefully you all can help me):

I have a test record in the OPTION file named
TestMenu.  Here is a dump of the record:

^DIC(19,10024,0)="TestMenu^Test2^^M^38^^^^^^^^y"
^DIC(19,10024,10,0)="^19.01IP^2^2"  <--Field 10/MENU
with 2 entries
^DIC(19,10024,10,1,0)="1337^FM"  <-- Entry#1,
IEN=1337=DIUSER
^DIC(19,10024,10,2,0)="281^MGR" <-- Entry#2,
IEN=281=XMMGR
^DIC(19,10024,10,"B",281,2)=""
^DIC(19,10024,10,"B",1337,1)=""
^DIC(19,10024,10,"C","FM",1)=""
^DIC(19,10024,10,"C","MGR",2)=""
^DIC(19,10024,10.1)="Some Short Text"
^DIC(19,10024,99)="59786,41786"
^DIC(19,10024,"U")="TEST2"

I have two goals
1. To be able to ask for a list of the multiple's
entries--i.e. to get back a list containing the
information in the DIUSER subrecord and the XMMGR
subrecord.  These will be scanned for matches, based
on user specifications.
2. To be able to specify one of these for
editing/creating with UPDATE^DIE or FILE^DIE

Because both of these two functions use the FDA format
of communication, I assume I would use the same data
setup for both.

I found an example that seem close to what I need:
A)    FDA(42,19,"+1,",.01)="NAME OF OPTION"
B)    FDA(42,19,"+1,",1)="MENU TEXT OF NEW OPTION"    
C)    FDA(42,19.01,"+2,+1,",.01)=45 
D)    FDA(42,19.01,"+2,+1,",2)="TM" 
E)    FDA(42,19.01,"+3,+1,",.01)=408  

Here it looks like first a new record is added to file
19 (the OPTION file), and the IEN for this is accessed
through the "+1" symbol.  Then, on line C, a record is
added to subfile number 19.01 (which I happen to know
is multiple-field-number 10), and the IEN for this
addition is acessed through the "+2" symbol.  And
finally on line E an other record is added with "+3".

In my situation, I will know the IEN of the upper
level data (i.e. 10024 from the data above), so would
I use the following?
  FDA(19.01,"?1,10024,",.01)="DIUSER"

But using this method is only allowed with updating or
filing--not finding.  So I don't get a chance to
screen the matches before they are used for the
editing...

----
Let me change gears here for a minute.
I have figured out how to search for value "DIUSER" in
field .01 in subfile 19.01, contained in record
IEN=10024.  How it knows that 10024 is in file 19 is a
mystery to me.

do
FIND^DIC(19.01,",10024,","@;.01","B","DIUSER","B","","","","OUT")

GTM>zwr OUT
OUT("DILIST",0)="1^*^0^"
OUT("DILIST",0,"MAP")=.01
OUT("DILIST",2,1)=1
OUT("DILIST","ID",1,.01)="DIUSER"

Now, how to put this information into an FDA to
specify the specific data that I want to edit with
UPDATE^DIE

Hmmm, this interface/API is difficult to learn :-(

Thanks for your help all.
I think I'm out of time to work on this today

Kevin
-------------------------
P.S., to use KEYS, don't I have to have an index on
the field in question?  I can't depend on that in a
scription situation--the user could specify to match
on any given field.  So I think that getting a list
and applying screening logic would be the way to
go--at least the way that seems most straightforward
to me.

thanks
Kevin



--- Greg Kreis <[EMAIL PROTECTED]> wrote:

> I like Skip's idea as well.  Perhaps KEYS are right
> on the money for 
> your goal.
> 
> Greg Kreis wrote:
> 
> > If you want more control that ?+, you could do
> your own retrievals 
> > into the multiple with a DBS call, apply your
> logic and then use the 
> > IENs returned by the lookup to set the IENS for
> the updater...
> >
> > Good luck!
> >
> > Kevin Toppenberg wrote:
> >
> >>Greg,
> >>
> >>Thanks for your reply.
> >>
> >>I want to be able to run my script, and then--if
> >>needed--run it again, without it adding new
> entries
> >>each time.  So sometimes I will be adding records,
> and
> >>sometimes stuffing old ones.
> >>
> >>I think the specier "?+" will cover this
> situation. 
> >>The only limitation of this is that I think it
> only
> >>uses the ".01" field when searching for a
> pre-existing
> >>record.  I wanted to have my script be more
> flexible
> >>than that.
> >>
> >>I think I will be able to use what you have told
> me to
> >>come up with a solution.  I'll ask more later if I
> >>need.
> >>
> >>Thanks again
> >>Kevin
> >>
> >>
> >>--- Greg Kreis <[EMAIL PROTECTED]> wrote:
> >>
> >>  
> >>
> >>>The 2 is the IEN in the multiple.  You don't want
> to
> >>>encode the literal 
> >>>IENm, as you adding values, not accessing
> existing
> >>>ones.  Instead, look 
> >>>into the 'extended IENS' concepts of + and ?. The
> >>>use of + requests a 
> >>>record to be added in the multiple and the ?
> permits
> >>>the value to be 
> >>>'found' before deciding to add (if the +
> accompanies
> >>>it).  While 
> >>>simplistic, this lets you avoid duplicating
> entries.
> >>>
> >>>So you might use an IENS of '+9,250' where the
> 250
> >>>is IEN 250 in the 
> >>>main file and +9 means you are requesting the
> >>>addition of an entry in 
> >>>the multiple.  I used 9 to indicate it is just a
> >>>placeholder and is only 
> >>>needed if you want to discover the IEN that was
> >>>created for the new 
> >>>entry in the multiple (the 9 is a subscript in a
> >>>returned array of 
> >>>assigned IENs).
> >>>
> >>>Kevin Toppenberg wrote:
> >>>
> >>>    
> >>>
> >>>>I am trying to wrap my mind around adding data
> with
> >>>>multiples.  I wonder if someone can help me.
> >>>>
> >>>>My goal is to enable my scripting system to
> process
> >>>>the following request:
> >>>>
> >>>> <File id="TestMenu" File="OPTION">
> >>>>  <Field id="NAME">TestMenu</Field>
> >>>>  <Field id="MENU TEXT">Test2</Field>
> >>>>  <Field id="CREATOR">Dodd,Norman"</Field>
> >>>>  <Field id="Short Menu Text">Some Short
> >>>>      
> >>>>
> >>>Text</Field>
> >>>    
> >>>
> >>>>  <Field id="DELEGABLE">YES</Field>
> >>>>  <Field id="TYPE">menu</Field>
> >>>>  <Field id="MENU/.01">DIUSER</Field>
> >>>>  <Field id="MENU/SYNONYM">FM2</Field>
> >>>>  <Field id="MENU/DISPLAY ORDER">1</Field>
> >>>>  <Field id="MENU/.01">XMMGR</Field>
> >>>>  <Field id="MENU/SYNONYM">X2</Field>
> >>>>  <Field id="MENU/DISPLAY ORDER">1</Field>
> >>>> </File>
> >>>>
> >>>>I parse the above into the following structure,
> >>>>      
> >>>>
> >>>with
> >>>    
> >>>
> >>>>this format:
> >>>>      
> >>>>
>
>>>Data(EntryNumber,FieldNum,[SubEntryNumber,FieldNumber])
> >>>    
> >>>
> >>>>Data(0,"Entries")=7
> >>>>Data(0,"File")=19
> >>>>Data(0,"File","Global")="^DIC(19,"
> >>>>Data(1,.01)="TestMenu"
> >>>>Data(1,.01,"MatchThis")=1
> >>>>Data(2,1)="Test2"
> >>>>Data(3,3.6)="Dodd,Norman"""
> >>>>Data(4,10.1)="Some Short Text"
> >>>>Data(5,13)="YES"
> >>>>Data(6,4)="menu"
> >>>>Data(7,10,0,"Entries")=2
> >>>>Data(7,10,0,"File")=19.01
> >>>>Data(7,10,1,.01)="DIUSER"
> >>>>Data(7,10,1,.01,"MatchThis")=1
> >>>>Data(7,10,1,2)="FM2"
> >>>>Data(7,10,1,3)=1
> >>>>Data(7,10,2,.01)="XMMGR"
> >>>>Data(7,10,2,.01,"MatchThis")=1
> >>>>Data(7,10,2,2)="X2"
> >>>>Data(7,10,2,3)=1
> >>>>
> >>>>
> >>>>I am able to work with the standard
> >>>>      
> >>>>
> >>>("non-multiple")
> >>>    
> >>>
> >>>>fields without any problem.  I use FILE^DIE to
> >>>>      
> >>>>
> >>>stuff a
> >>>    
> >>>
> >>>>pre-existing record with the data that I want,
> or I
> >>>>use UPDATE^DIE if I need to create a new record.
>  I
> >>>>      
> >>>>
> >>>do
> >>>    
> >>>
> >>>>a search for pre-existing data based on the
> >>>>"MatchThis" entries, and get an IEN (internal
> entry
> >>>>number) of the record to work with.
> >>>>
> >>>>But now I am working to get the sub-file part
> >>>>      
> >>>>
> >>>working.
> >>>    
> >>>
> >>>>I don't know how to get the IEN of the subfile
> >>>>entries.
> >>>>
> >>>>In the above example, I am working with the
> OPTION
> >>>>file.  Field MENU(#10) is a multiple, meaning
> that
> >>>>when I add data to that field, the database
> really
> >>>>holds a list of 'pointers' to entries in another
> >>>>      
> >>>>
> >>>file.
> >>>    
> >>>
> >>>>I.e. the MENU sub file number is 19.01.  So If I
> >>>>      
> >>>>
> >>>have
> >>>    
> >>>
> >>>>2 'multiple' entries in field 10, then field 10
> 
=== message truncated ===





--- Greg Kreis <[EMAIL PROTECTED]> wrote:

> I like Skip's idea as well.  Perhaps KEYS are right
> on the money for 
> your goal.
> 
> Greg Kreis wrote:
> 
> > If you want more control that ?+, you could do
> your own retrievals 
> > into the multiple with a DBS call, apply your
> logic and then use the 
> > IENs returned by the lookup to set the IENS for
> the updater...
> >
> > Good luck!
> >
> > Kevin Toppenberg wrote:
> >
> >>Greg,
> >>
> >>Thanks for your reply.
> >>
> >>I want to be able to run my script, and then--if
> >>needed--run it again, without it adding new
> entries
> >>each time.  So sometimes I will be adding records,
> and
> >>sometimes stuffing old ones.
> >>
> >>I think the specier "?+" will cover this
> situation. 
> >>The only limitation of this is that I think it
> only
> >>uses the ".01" field when searching for a
> pre-existing
> >>record.  I wanted to have my script be more
> flexible
> >>than that.
> >>
> >>I think I will be able to use what you have told
> me to
> >>come up with a solution.  I'll ask more later if I
> >>need.
> >>
> >>Thanks again
> >>Kevin
> >>
> >>
> >>--- Greg Kreis <[EMAIL PROTECTED]> wrote:
> >>
> >>  
> >>
> >>>The 2 is the IEN in the multiple.  You don't want
> to
> >>>encode the literal 
> >>>IENm, as you adding values, not accessing
> existing
> >>>ones.  Instead, look 
> >>>into the 'extended IENS' concepts of + and ?. The
> >>>use of + requests a 
> >>>record to be added in the multiple and the ?
> permits
> >>>the value to be 
> >>>'found' before deciding to add (if the +
> accompanies
> >>>it).  While 
> >>>simplistic, this lets you avoid duplicating
> entries.
> >>>
> >>>So you might use an IENS of '+9,250' where the
> 250
> >>>is IEN 250 in the 
> >>>main file and +9 means you are requesting the
> >>>addition of an entry in 
> >>>the multiple.  I used 9 to indicate it is just a
> >>>placeholder and is only 
> >>>needed if you want to discover the IEN that was
> >>>created for the new 
> >>>entry in the multiple (the 9 is a subscript in a
> >>>returned array of 
> >>>assigned IENs).
> >>>
> >>>Kevin Toppenberg wrote:
> >>>
> >>>    
> >>>
> >>>>I am trying to wrap my mind around adding data
> with
> >>>>multiples.  I wonder if someone can help me.
> >>>>
> >>>>My goal is to enable my scripting system to
> process
> >>>>the following request:
> >>>>
> >>>> <File id="TestMenu" File="OPTION">
> >>>>  <Field id="NAME">TestMenu</Field>
> >>>>  <Field id="MENU TEXT">Test2</Field>
> >>>>  <Field id="CREATOR">Dodd,Norman"</Field>
> >>>>  <Field id="Short Menu Text">Some Short
> >>>>      
> >>>>
> >>>Text</Field>
> >>>    
> >>>
> >>>>  <Field id="DELEGABLE">YES</Field>
> >>>>  <Field id="TYPE">menu</Field>
> >>>>  <Field id="MENU/.01">DIUSER</Field>
> >>>>  <Field id="MENU/SYNONYM">FM2</Field>
> >>>>  <Field id="MENU/DISPLAY ORDER">1</Field>
> >>>>  <Field id="MENU/.01">XMMGR</Field>
> >>>>  <Field id="MENU/SYNONYM">X2</Field>
> >>>>  <Field id="MENU/DISPLAY ORDER">1</Field>
> >>>> </File>
> >>>>
> >>>>I parse the above into the following structure,
> >>>>      
> >>>>
> >>>with
> >>>    
> >>>
> >>>>this format:
> >>>>      
> >>>>
>
>>>Data(EntryNumber,FieldNum,[SubEntryNumber,FieldNumber])
> >>>    
> >>>
> >>>>Data(0,"Entries")=7
> >>>>Data(0,"File")=19
> >>>>Data(0,"File","Global")="^DIC(19,"
> >>>>Data(1,.01)="TestMenu"
> >>>>Data(1,.01,"MatchThis")=1
> >>>>Data(2,1)="Test2"
> >>>>Data(3,3.6)="Dodd,Norman"""
> >>>>Data(4,10.1)="Some Short Text"
> >>>>Data(5,13)="YES"
> >>>>Data(6,4)="menu"
> >>>>Data(7,10,0,"Entries")=2
> >>>>Data(7,10,0,"File")=19.01
> >>>>Data(7,10,1,.01)="DIUSER"
> >>>>Data(7,10,1,.01,"MatchThis")=1
> >>>>Data(7,10,1,2)="FM2"
> >>>>Data(7,10,1,3)=1
> >>>>Data(7,10,2,.01)="XMMGR"
> >>>>Data(7,10,2,.01,"MatchThis")=1
> >>>>Data(7,10,2,2)="X2"
> >>>>Data(7,10,2,3)=1
> >>>>
> >>>>
> >>>>I am able to work with the standard
> >>>>      
> >>>>
> >>>("non-multiple")
> >>>    
> >>>
> >>>>fields without any problem.  I use FILE^DIE to
> >>>>      
> >>>>
> >>>stuff a
> >>>    
> >>>
> >>>>pre-existing record with the data that I want,
> or I
> >>>>use UPDATE^DIE if I need to create a new record.
>  I
> >>>>      
> >>>>
> >>>do
> >>>    
> >>>
> >>>>a search for pre-existing data based on the
> >>>>"MatchThis" entries, and get an IEN (internal
> entry
> >>>>number) of the record to work with.
> >>>>
> >>>>But now I am working to get the sub-file part
> >>>>      
> >>>>
> >>>working.
> >>>    
> >>>
> >>>>I don't know how to get the IEN of the subfile
> >>>>entries.
> >>>>
> >>>>In the above example, I am working with the
> OPTION
> >>>>file.  Field MENU(#10) is a multiple, meaning
> that
> >>>>when I add data to that field, the database
> really
> >>>>holds a list of 'pointers' to entries in another
> >>>>      
> >>>>
> >>>file.
> >>>    
> >>>
> >>>>I.e. the MENU sub file number is 19.01.  So If I
> >>>>      
> >>>>
> >>>have
> >>>    
> >>>
> >>>>2 'multiple' entries in field 10, then field 10
> 
=== message truncated ===



                
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Hardhats-members mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to