QTIPS - Updating Multiple Dictionaries With A Single Command

Published ByDateVersionKnowledge LevelKeywords
Sprezzatura Ltd01 AUG 19922.12+EXPERTDICT, SYSCOLUMNS, DICTCOMPILE, EDIT_SOFTKEYS

Jim Poe of Adobe Mountain Systems Inc writes as follows - "If you are updating a system and need to update more than one dictionary, you can accomplish all the updates in one copy command by using the SYSCOLUMNS file as the destination file. As an example

     Updating file DICT.CUSTOMERS, field NAME
     Updating file DICT.INVOICES, field INVOICE_DATE
     Use this command:
     COPY UPDATE_FILE CUSTOMERS*NAME INVOICES*INVOICE_DATE TO:(SYSCOLUMNS

One caveat - SYSCOLUMNS will translate FILE_NAME to FILE.NAME if appropriate, but will not translate FIELD_NAME to FIELD.NAME."

He then expands on this by saying

"When updating an include record such as an equate list that is used in multiple table dictionaries you can do the following:

     SELECT SYSCOLUMNS IF FORMULA [] "$Insert Bp,Dict_Equates"
     DICTCOMPILE SYSCOLUMNS

Then finally to ensure that he has really earned his sweatshirt he comments

"The following code is useful when called from the editor softkeys. It allows you to retrieve a formula from a dictionary item or a record from a source file and have it inserted in the current formula or record that you are editing"

      Subroutine Insert_Source(Param)
       @Pseudo = ""
       * Use existing system window to get file and record(s) to merge
       Call Catalyst("W", "@COMMANDS@ EDIT.ANOTHER")
       If Len(@Pseudo<1>) Then
        File = @Pseudo<1>
        Record = @Pseudo<2>
        If File[1,4] = "DICT" Then
          Record = Xlate(File,Record, 8, "X")
          Convert @Fm To @Vm In Record
        End Else
          Record = Xlate(File, Record, "", "X")
        End
        /*
          Now put the information into @Cur.Buf and reset Cur.Buf<1> to
          point to it. Use 6 as this is beyond where Cut/Paste normally
          operates
        */
        @Cur.Buf<1> = 6
        @Cur.Buf<7> = Record
        @Data = @Edit.Keys<10> ; * ^F4 - paste
       End
      Return

Simply catalog the above program then add it as a softkey using the CW EDIT_SOFTKEYS command as documented in the 2.12 upgrade information.

(Volume 4, Issue 4, Pages 4,5)