Every thing is so much easier using 4D methods rather than an editor! I can install my methods (tested and working for over 20 years) for the price of 1 days' work:)
On Fri, Sep 16, 2016 at 5:37 PM, Jim Dorrance <jim.dorra...@gmail.com> wrote: > Here is 1 of the methods that handles a theme: > > //JD20141120 > //Method: Ks_PaperSizes ($patResourcePaths;$pnResID;$ > pnIndex;$pnFamily;$pnValue;$patConstants) > //Description: > > > C_TEXT($1;$tDomRoot) //DOCUMENT ROOT > C_POINTER($2;$pnResID) //THE RES ID POINTER > C_POINTER($3;$pnIndex) //THE ITEM POINTER > C_POINTER($4;$pnFamily) //THE FAMILY POINTER > C_POINTER($5;$pnValue) //THE VALUE POINTER > C_POINTER($6;$patConstants) //THE STRING ARRAY > > > If (Count parameters=6) > > $tDomRoot:=$1 > $pnResID:=$2 > $pnIndex:=$3 > $pnFamily:=$4 > $pnValue:=$5 > $patConstants:=$6 > > $pnResID->:=$pnResID->+1 > $pnIndex->:=0 > $pnFamily->:=0 > $pnValue->:=0 > > C_TEXT($tGroupName) > $tGroupName:="PaperSizes" > > ARRAY TEXT($patConstants->;1000) > > //PAPER SIZES http://resources.printhandbook.com/pages/paper- > size-chart.php > > //ALL SIZES ARE IN MM > > //MISCELLANEOUS > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_Legal")+":"+"Legal"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_LegaW")+":"+String(216)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_LegaH")+":"+String(356)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_JuniorLegal")+":"+"Junior Legal"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_JuniorLegalW")+":"+String(127)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_JuniorLegalH")+":"+String(203)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_1/3A4")+":"+"1/3 A4"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_1/3A4W")+":"+String(99)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_1/3A4H")+":"+String(210)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_GutenbergBible")+":"+"Gutenberg Bible"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_GutenbergBibleW")+":"+String(280)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_GutenbergBibleH")+":"+String(398)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_CDCaseInsert")+":"+"CD case insert"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_CDCaseInsertW")+":"+String(120)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_CDCaseInsertH")+":"+String(120)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A4Square")+":"+"A4 square"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A4SquareW")+":"+String(210)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A4SquareH")+":"+String(210)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_AFormatPaperback")+":"+"A format paperback"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_AFormatPaperbackW")+":"+String(110)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A0H")+":"+String(178)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_BFormatPaperback")+":"+"B format paperback"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_BFormatPaperbackW")+":"+String(130)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_BFormatPaperbackH")+":"+String(198)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_48SheetBillboard")+":"+"48 sheet billboard"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_48SheetBillboardW")+":"+String(6096)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_48SheetBillboardH")+":"+String(3048)+":L" > > > //INTERNATIONAL A PAPER SIZES > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A0")+":"+"A0"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A0W")+":"+String(841)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A0H")+":"+String(1189)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A1")+":"+"A1"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A1W")+":"+String(594)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A1H")+":"+String(841)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A2")+":"+"A2"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A2W")+":"+String(420)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A2H")+":"+String(594)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A3")+":"+"A3"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A3W")+":"+String(297)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A3H")+":"+String(420)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A4")+":"+"A4"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A4W")+":"+String(210)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A4H")+":"+String(297)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A5")+":"+"A5"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A5W")+":"+String(148)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A5H")+":"+String(210)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A6")+":"+"A6"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A6W")+":"+String(105)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A6H")+":"+String(148)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A7")+":"+"A7"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A7W")+":"+String(74)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A7H")+":"+String(105)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A8")+":"+"A8"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A8W")+":"+String(52)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A8H")+":"+String(74)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A9")+":"+"A9"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A9W")+":"+String(37)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A9H")+":"+String(52)+":L" > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A10")+":"+"A10"+":S" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A10W")+":"+String(26)+":L" > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kPaper_A10H")+":"+String(37)+":L" > > > > $patConstants->{TBox_Increment ($pnIndex)}:=Ks_TBox_SubString_tGET > ("kAttrArIndex_nCount")+":"+String($pnValue->)+":L" > > //WRITE THE RESOURCE > > Ks_TBox_XLIFF_ArrayToXLIFF ($tDomRoot;$tGroupName;$ > pnResID;$pnIndex;$pnFamily;$pnValue;$patConstants) > > End if > > > On Fri, Sep 16, 2016 at 5:36 PM, Jim Dorrance <jim.dorra...@gmail.com> > wrote: > >> 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_Fil >> eName;$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;$patCo >> nstants) >> Ks_PaperSizes ($tXLIFF_DomRoot;$pnResID;$pnI >> ndex;$pnFamily;$pnValue;$patConstants) >> Ks_SVG ($tXLIFF_DomRoot;$pnResID;$pnIndex;$pnFamily;$pnValue;$patCo >> nstants) >> >> //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. >> > > > > -- > 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 **********************************************************************