It's in the Classic FileMan calls section of the Programmers Guide. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Toppenberg Sent: Wednesday, August 04, 2004 11:05 AM To: [EMAIL PROTECTED] Subject: RE: [Hardhats-members] Subfile numbers
Cameron, I am looking in the Fileman v22.0 Programmer's manual, and I can't find documentation on DO^DIC1. Can you tell me how to use it, or direct me in the correct direction? Thanks Kevin --- "Schlehuber, Cameron" <[EMAIL PROTECTED]> wrote: > When you get the actual sub-file number, use DO^DIC1 > rather than hitting > the global directly. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Kevin > Toppenberg > Sent: Wednesday, August 04, 2004 9:21 AM > To: [EMAIL PROTECTED] > Subject: Re: [Hardhats-members] Subfile numbers > > I don't always understand what I read. I think what > these links below will do is display the info onto > the > screen. I need a programatic solution. > > After a little digging in the data dictionary file, > I > found a low-level way to solve this problem. Here > is > the code incase anyone is interested: > > Thanks > Kevin > > SFN(FileNum,FieldNum) > ;"Purpose: If FieldNum is a "multiple" field, > ;" then this function should return > "subfile" > ;" number of the sub file. > ;"Input: FileNum-- the file number (or sub file > ;" number) that field exists in > ;" FieldNum-- the field number in file to lookup > ;" (not a name) > ;"Result: Returns sub file number, or 0 if not found > > ;" or invalid > > new Info > new Result set Result=0 > new Output,Error > > ;"First, verify file (or subfile) exists > if $$VFILE^DILFD(FileNum)=0 do goto GSFDone > . write "File: ",FileNum," invalid",! > > ;"Next, ensure Field exists in file > if $$VFIELD^DILFD(FileNum,FieldNum)=0 do goto > GSFDone ;"abort > . write "Field: ",FieldNum," is invalid.",! > > ;"Next, ensure field is a multiple > do > FIELD^DID(FileNumber,FieldNumber,,"MULTIPLE-VALUED","Output","Error") > if $get(Output("MULTIPLE-VALUED"),0)=0 do goto > GSFDone ;"abort > . write "Field is not a 'Multiple'/Subfile",! > > ;"Now actually get subfile number > set Info=$get(^DD(FileNumber,FieldNumber,0),0) > if Info=0 goto GSFDone > set Result=+$piece(Info,"^",2) > > GSFDone quit Result ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ Hardhats-members mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hardhats-members