KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Exporting Database parameters to text
PRODUCT: 4D | VERSION: 16 | PLATFORM: Mac & Win
Published On: April 23, 2018

Here is a utility method to export the DATABASE PARAMETERS in a 4D database which can be useful to debug issues on a 4D database:

// ---------------------------------------------------------------------------
// Name: EXPORT_DB_PARAMS_TO_TEXT
// Description: Method will call GET DATABASE PARAMETERS and write to a file.
// name to save a file and file type in the Object field record.
// --------------------------------------------------------------------------
C_TIME($vhDoc)
C_TEXT($loc;$output)
C_LONGINT($i;$output1)

$loc:=Get 4D folder(Current resources folder)+"dbSettings.txt"

If (Test path name($loc)#Is a document)
 $vhDoc:=Create document($loc)
Else
 $vhDoc:=Append document($loc)
End if

If (OK=1)
 SEND PACKET($vhDoc;"================================="+char(13)+char(10))
 SEND PACKET($vhDoc;"Selector--Funct Result--Str value"+char(13)+char(10))
 SEND PACKET($vhDoc;"================================="+char(13)+char(10))

For ($i;1;105)

 Case of
  : ($i=32)
  : ($i=38)
  : ((($i>=70) & ($i<=73)) | ($i=77) | ($i=78))
  : ($i=93)
  Else
   $output1:=Get database parameter($i;$output)
   $textString:=String($i;"000")+": "+String($output1)+", "+$output+Char(13)+Char(10)
   SEND PACKET($vhDoc;$textString)
   $textString:=""
  End case

 End for
 CLOSE DOCUMENT($vhDoc)
End if



Here is an example of using the command:

EXPORT_DB_PARAMS_TO_TEXT


A text file will produce the following but with a total of 105 items:



The selector corresponds to the SET DATABASE PARAMETER documentation:




See Also: