KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to use multiple person dictionaries
PRODUCT: 4D | VERSION: 2004.1 | PLATFORM: Mac & Win
Published On: April 7, 2005

The option to synchronize multiple personal dictionaries simultaneously is not available with 4th Dimension's database. However, you may for example have a personal medical dictionary that you would like to use with a personal technical dictionary in your directory. 4th Dimension only allows the use of one dictionary at a time. One way to get around this is to merge the two personal dictionaries together. To achieve this you will need to write 4D code. The code below is merging two personal dictionary—English and French dictionary files (perso69632 and perso262144) into one file.

Example code provided below merges two personal dictionaries:

C_TIME($ref1;$ref2)
C_TEXT($var1)

$ref1:=Append document("C:\\Documents and Settings\\All Users\\Application Data\\4D\\perso69632.dic";"dic")
$ref2:=Open document("C:\\Documents and Settings\\All Users\\Application Data\\4D\\perso262144.dic";"dic")

If (OK=1) ` If the document was opened
 Repeat ` Loop until no more data
  RECEIVE PACKET($ref2;$Var1;Char(Carriage return ))
  If (OK=1) ` If we are not beyond the end of the document
  SEND PACKET($ref1;$Var1+Char(Carriage return ))
  End if
 Until (OK=0)
 SEND PACKET($ref1;Char(Line feed ))
 CLOSE DOCUMENT($ref1) ` Close the document
 CLOSE DOCUMENT($ref2) ` Close the document
End if