Here is my Ks method:

  //Method: Ks ($bConfirm)
  //Description:


C_BOOLEAN($1;$bConfirm)
If (Count parameters>0)
$bConfirm:=$1
Else
$bConfirm:=True
End if

  //XLIFF DOCUMENT NAME AND ROOT NAME

C_TEXT($tXLIFF_FileName;$tXLIFF_DomRoot)
$tXLIFF_FileName:="ksLabels"

C_POINTER($ptXLIFF_FileName;$ptXLIFF_DomRoot)
$ptXLIFF_FileName:=->$tXLIFF_FileName
$ptXLIFF_DomRoot:=->$tXLIFF_DomRoot

  //OPEN FILE

C_TEXT($tErrorMethod)
$tErrorMethod:=Ks_TBox_Build_Open_tGET
($tXLIFF_FileName;$ptXLIFF_FileName;$ptXLIFF_DomRoot)

  //INITIALIZE A STRING ARRAY OF CREATED CONSTANTS

ARRAY TEXT($atConstants;0)
C_POINTER($patConstants)
$patConstants:=->$atConstants

  //COUNTERS/VALUES

ARRAY LONGINT($anFieldColumnValues;4)
C_POINTER($panIndices;$pnResID;$pnIndex;$pnFamily;$pnValue)
$panIndices:=->$anFieldColumnValues
$pnResID:=->$anFieldColumnValues{1}  //THE CURRENT CONSTANT'S RESOURCE ID
$pnIndex:=->$anFieldColumnValues{2}  //THE CURRENT CONSTANT'S ARRAY ELEMENT
IN $patConstants
$pnValue:=->$anFieldColumnValues{3}  //A LONGINT USED FOR INCREMENTAL
VALUES (WHEN USEFULL)
$pnFamily:=->$anFieldColumnValues{4}  //A LONGINT USED FOR THE FAMILY
MODULO (WHEN USEFULL)

$pnResID->:=19999  //WILL BE AUGMENTED FOR EACH NEW LOGICAL GROUP
$pnIndex->:=0
$pnFamily->:=0
$pnValue->:=0

  //BUILD CONSTANTS ( YOUR METHODS HERE)

Ks_Labels
($tXLIFF_DomRoot;$pnResID;$pnIndex;$pnFamily;$pnValue;$patConstants)
Ks_PaperSizes
($tXLIFF_DomRoot;$pnResID;$pnIndex;$pnFamily;$pnValue;$patConstants)
Ks_SVG ($tXLIFF_DomRoot;$pnResID;$pnIndex;$pnFamily;$pnValue;$patConstants)

  //CLOSE CREATED FILES

Ks_TBox_Build_Close ($ptXLIFF_FileName;$ptXLIFF_DomRoot)

  //RESTORE ERROR HANDLER

ON ERR CALL($tErrorMethod)

ARRAY TEXT($atConstants;0)

If ($bConfirm)
C_TEXT($tConfirm)
$tConfirm:="Do you want to restart the data base
now?"+Char(13)+Char(13)+"The constants will be charged with the next
opening with your data base."
CONFIRM($tConfirm;"Yes";"No")
End if

If (OK=1)
OPEN DATA FILE(Data file)
End if


On Fri, Sep 16, 2016 at 5:34 PM, Jim Dorrance <jim.dorra...@gmail.com>
wrote:

> Once again,
>
> Constants are not necessary after compilation, ie they take up no place in
> memory if they are deleted. They must only be saved if they are used as a
> parameter in an Execute method.
>
> Here is some code from my On Startup methode:
>
>   //WEB20141006
>   //Method: Ks_TBox_OnStartup
>   //Description:
>
>   //DELETES Ks IF THE BASE IS COMPILED (IF NECESSARY),
>   //OR RE-CREATES THEM IF THE BASE IS INTERPRETED  (IF NECESSARY)
>
> C_TEXT($tFolderPath)
> $tFolderPath:=Get 4D folder(Current Resources folder)
> If (Test path name($tFolderPath)=Is a folder)
>
> C_TEXT($tFilePath)
> $tFilePath:=$tFolderPath+"ksLabels.xlf"
>
> C_BOOLEAN($bKsExist)
> $bKsExist:=(Test path name($tFilePath)=Is a document)
>
> If (Is compiled mode)
>
> If ($bKsExist)
> DELETE DOCUMENT($tFilePath)
> End if
>
> Else
>
> If (Not($bKsExist))
> Ks
> End if
>
> End if
>
> End if
> --
> Jim Dorrance
> jim.dorra...@gmail.com
> 4...@dorrance.eu
> www.4d.dorrance.eu
>
> PS: If you know of anyone that needs an experienced 4D programmer to add
> energy and experience to their team, please let me know. I have
> experience in many areas. Reasonable rates. Remote or Paris only.
>



-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to