if(t==this){
 t.xxtree42.setDefer();
}else{
 t.xxtree42.setSubload();
 t.xxtree42.emptyNodes();
 t.xxtree42.setUndefer();
}
t.xxtree42.add(42,-1,'Langage','');
t.xxtree42.add(284,42,'Généralités','The MyPitSelf language evolves constantly because of its own concept and because improvements are brought, but it will remain with only function calls returning true or false. \n<br />\n<br />\nIt is a "blending" of \n<br />\nlisp for the nested treatments and true or false return values\n<br />\nC for the function calls\n<br />\nAssembler for the stack mechanism\n<br />\n\n<br />\nThe best method to learn this language is like for all languages:\n<br />\n- Look and do the development examples given above, this will make you familiar to the basic concepts and the development environment.\n<br />\n- See examples of this language. for this, go to the MyPitSelf environment as user 1/1 and to choose in the tool menu the button "Set or unset Developping mode for MyPitSelf" and to look at the functions. \n<br />\n<br />\nThis function refererence is mostly done so that when I need to write some source, I can copy the example and then paste it in the source.\n<br />\n<br />\nWhen you are in the function list, the <img src="img/picto/13x13/pr.png" alt="" /> button gives a result under a table view. \n<br />\nIn other words, if a function is f(g(x),h(y)), the table result of this function is \n<br />\n\n<br />\n<table summary="" border="0" cellpadding="0" cellspacing="0" >\n<tr class="zz_headerlist">\n<td>Function#<\/td>\n<td>Parent<br />Number<\/td>\n<td>Order In<br />Parent<\/td>\n<td>Function<br /> Name<\/td>\n<td>Function<br /> Type<\/td>\n<td>Number Of<br />Children<\/td>\n<td>Level<\/td><\/tr><tr class="LIST"><td>0<\/td><td>-1<\/td><td>0<\/td><td>0<\/td><td>INIT<\/td><td>1<\/td><td>0<\/td><\/tr>\n<tr class="zz_list"><td>1<\/td><td>0<\/td><td>1<\/td><td>f<\/td><td>formula<\/td><td>2<\/td><td>1<\/td><\/tr>\n<tr class="LIST"><td>2<\/td><td>1<\/td><td>1<\/td><td>g<\/td><td>formula<\/td><td>1<\/td><td>2<\/td><\/tr>\n<tr class="LIST"><td>3<\/td><td>2<\/td><td>1<\/td><td>x<\/td><td>zone<\/td><td>0<\/td><td>3<\/td><\/tr>\n<tr class="LIST"><td>4<\/td><td>1<\/td><td>2<\/td><td>h<\/td><td>formula<\/td><td>1<\/td><td>2<\/td><\/tr>\n<tr class="LIST"><td>5<\/td><td>4<\/td><td>1<\/td><td>y<\/td><td>zone<\/td><td>0<\/td><td>3<\/td><\/tr>\n<\/table>\n<br />\nWith these data, a procedure can implode it to rebuilt the original string [ f(g(x),h(y)) ]. \n<br />\nThis means that if some modification are done on the language structure, by putting this table in a database table and working on it ( ie add/move/suppress records ), one can make the functions evolve. \n<br />\nFor example, like in the functions attached to a list, I decided once to put the field specification inside a Field() function. \n<br />\nThe old format was: \n<pre>\nTac(\n T0.ID,\n doSomething(),\n)\n<\/pre>\nAnd the new format is: \n<pre>\nTac(\n Field(T0.ID),\n doSomething(),\n)\n<\/pre>\nTo do this, I wrote functions that did that job. \n<br />\nThat is the reason why even if I know that certains things have to be corrected, I do not panic about correcting all the sources. \n<br />\n\n<br />\nFurthermore, the possibility to put the function in tables helps to trace every use of data. As the SQL phrases are written in database in an organized way and then translated into languages functions, one can know which data is used where. \n<br />\n\n<br />\nThe use of this possibility is for the moment in only few places but will be generalized to have a trace of everything. \n<br />\n\n<br />\nSome functions have no arguments, some others fixed arguments, some others fixed functions arguments and other variable functions arguments. \n<br />\nA function always return true or false. \n<br />\n\n<br />\nThe arguments of the functions are inclosed in parenthesis and separated by comas. \n<br />\n\n<br />\nLine comments start with // and they end with the end of line. \n<br />\nBlock comments start with /*, end with */, these delimiters must be on the first column and can be nested. \n<br />\nThe \' is a string delimitter, the escape character is \\');
t.xxtree42.add(59,42,'Variables','Variables can contain any basic type of data ( strings, dates, times...) but not yet arrays\n<br />\nThere are two sets of variables.\n<br />\nSome are declared and named ( see SetVar below ) and are contained in a stack: It\'s the variable stack.\n\n<br />\n<br />\nOthers are put in a stack by programs. It\'s the Call Stack.\n<br />\nAs MyPitSelf is based on data, some instructions extract data from the databases and puts them in the call stack.\n<br />\n<br />\n\nThe way to reach the variables put in the call stack is by giving a number which represents the position in the call stack:\n<br />\nIf the call stack contains ( it is filled going downwards )\n<br />\n<pre>\nhello\nworld\n<\/pre>\n<br />\n1 represents world\n<br />\n2 represents hello\n<br />\n<br />\nSome variables are globals ( particulary predefined variables )\n<br />\n<br />\nThe hw() function displays the content of the call stack ( "hello, world" )\n<br />\nthe pvs() function displays the content of the variable stack. ( print variable stack ) ');
t.xxtree42.add(60,59,'SetVar','SetVar(xxxx,yyyy[,yyyy]) for local variables\n<br />\nor\n<br />\nSetVarG(xxxx,yyyy[,yyyy]) for global variables\n<br />\n<br />\nWhere xxxx can be:\n<br />\na variable name ( no spaces or special characters admitted )\n<br />\nVar(xxxx) : The content of the variable whose name is xxxx. ( equivalent to the $$ in php ).\n<br />\n<br />\nyyyy can be:\n<br />\n-Var(zzzz) or VarG(zzzz): The content of the variable zzzz, zzzz must exist.\n<br />\n-Chr(n): where n is the ascii code of a character. It is useful for specials characters like Chr(10) or Chr(13)\n<br />\n-Cst(xxxx) : A constant, it can be a string or a number.\n<br />\n-n: A number which represents the niest last character of the CallStack.\n<br />\n-Display(nnnn) : nnnn is the message number in the msg list ( usefull for internationalisation )\n<br />\n-Funct(nnnn) : nnnn is a function number: It replaces the Cst(nnnn) because if someone give a new number mmmm to nnnn, all Funct(nnnn) will be moved to Funct(mmmm).\n<br />\n-Stack(oooo) : oooo is a name of a variable which contain the position of the element to fetch in stack.\n<br />\n-SessionVar(ssss) : ssss is a name of a constant to get in $_SESSION .\n<br />\n-HttpPostVar(pppp) : pppp is a name of a constant to get in $_POST .\n<br />\n-Num(qqqq,x) : qqqq is a name of a variable, x is the number of decimals.\n<br />\n-Env(rrrr) : rrrr is a constant representing the environment variable to get ( php getenv() )\n<br />\n-XVS(zzzz) : gets the content of the variable which is in the Variable stack ( zzz is the variable name )\n<br />\n<br />\nExamples:\n<xmp>\nSetVar(MyVar01,Cst(Hello),Chr(39),Chr(32),Cst(world)), // puts "hello, world" in MyVar01.\nSetVar(MyVar01,Cst(25.5)),                             // now, it contains 25.5\nSetVar(MyVar01,Cst(0)),                                // now, it contains 0\nSetVar(MyVar02,Cst(ACombinedvar),Var(MyVar01)),        // MyVar02 contains ACombinedVar0\nSetVar(Var(MyVar02),Cst(25.5))                  // ACombinedVar0 is created as a new variable\n                                                // and contains 25.5\nSetVar(toto,Display(1000011)) // puts the content of the message n# 1000011 in toto\n<\/xmp>');
t.xxtree42.add(61,59,'Variables prédéfinies','An environment has it\'s own variables like\n<br />\nthe folder of it\'s programs\n<br />\nThe user code of the current user,\n<br />\nDefault values for data ....\n<br />\n<br />\nGo to the profile menu and use the "see/hide function call" button to see function calls.\n<br />\nThen a <img src="img/picto/13x13/wi.png" /> button appears on the main menu ( print variable stack ).\n<br />\nThese predefined variables can be seen using this button. They start with xxx.\n<br />\nThese variable are in the variable stack just like the ones the ones declared with SetVarG.\n<br />\nThe pvs() function can be used to display variables in a program.\n<br />\n<br />\nFor the moment, one can update these variable which is absolutely not correct and has not to be done but this will be enhanced to have more control on the use of the "system variables" according to the user profile.');
t.xxtree42.add(62,59,'Opérations sur les variables','They are basic because most operations are done using values in the call stack.\n<br />\n<br />\n<xmp>AddVar(xxxx,yyyy)<\/xmp>\nAdds to xxxx ( must exist ) yyyy, yyyy can be: Cst(), Var(), n ( a value in the call stack )\n<br />\n<br />\n<xmp>SubVar(xxxx,yyyy)<\/xmp>\nSubs to xxxx ( must exist ) yyyy, yyyy can be: Cst(), Var(), n ( a value in the call stack )\n<br />\n<br />\n<xmp>MultVar(xxxx,yyyy)<\/xmp>\nMultiply to xxxx ( must exist ) yyyy, yyyy can be: Cst(), Var(), n ( a value in the call stack )\n<br />\n<br />\n<xmp>DivVar(xxxx,yyyy)<\/xmp>\nDivide xxxx ( must exist ) by yyyy, yyyy can be: Cst(), Var(), n ( a value in the call stack )\nIf yyyy = 0, it returns false. \n<br />\n<br />\n<xmp>RemainderVar(xxxx,yyyy)<\/xmp>\nxxxx % yyyy .\nIf yyyy = 0, it returns false. \n<br />\n<br />\nTo test if a variable exist, use this kind of source :\n<xmp>\nTac(\n Test(\n  Cond(IsSet(Var(MyVar))), // or Cond(IsSet(VarG(MyGlobalVar)))\n  IfTrue(\n   // do something\n  ),\n  IfFalse(\n   // do something else\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(63,59,'Tac ','Tac: pushes values into the callstack\n<xmp>\nTac(\n Var(xxxx),             // xxxx is a variable name\n VarG(xxxx),            // xxxx is a variable name\n Cst(yyyy)              // yyyy is a constant.\n Chr(zzzz)              // zzzz is a numeric value for an ascii code\n Display(nnnn)          // nnnn is a message number.\n Field(Tn.FieldName)    // The FieldName can be use in LISTFUNCT functions, ie T0.Name\n Funct(oooo)            // oooo is the number of the function to call\n ffff(),                // ffff is a function to call whose name is not \n                        // one of the previous in this list\n                        // The Function is called for execution\n)\n<\/xmp>\n<br />\n<br />\nExample:\n<xmp>\nTac(\n SetVar(MyVar,Cst(Hello,world)), // defines a variable "myVar" and puts hello, world in it\n Var(MyVar),                     // push the variable in the call stack\n out(1)                          // outputs the last variable in the call stack\n)                                // all variables pushed in this Tac() are poped\n<\/xmp>\n<br />\nThe Tn.Field name must be at the level one of the function. In this case the variable is transformed into a constant. ( use the Show source of your browser to see how the FUNCTION field is filled in any list screen ).\n<br />\n\nSo if a LISTFUNCT function is\n\n<xmp>\nTac(\n Field(T0.ID),\n out(1)\n)\n<\/xmp>\nand the result button is in front of the record ID 1234, the source will show something like:\n<xmp>\nonclick="document.XXFNCT.value=\'Tac( Cst(1234), out(1) )\'"\n<\/xmp>\n<br />\n');
t.xxtree42.add(98,59,'Swap','Puts in the call stack the value of a variable.\n<br />\nIt is usually used to return some values: as this language returns only true or false,\nif you want to get something different from a function call, you can use the\ncall stack and put some values in it.\n\n<br />\nExample\n<xmp>\n// Receives the field code and builds the string to build the sql for this field\nSetVar(FieldCode,1),\n\nTac(\n Var(FieldCode),\n R_1523_Select(\n  Do(\n   Take(T0.Name,T0.xRefData),\n   SetVar(FieldName,2),\n   SetVar(DataCode,1),\n   Tac(\n    Cst(0), // not system\n    Var(DataCode)\n    Funct(6091),  // builds for example \' varchar(50) NOT NULL\n    SetVar(SqlString,Cst(\'`\')Var(FieldName),Cst(\'`\'),Ret(1))\n    // now, SqlString contains `TheFieldName` varchar(50) NOT NULL\n   )\n  )\n )\n\n Swap(SqlString,1), // the function calling this one can do a\n                    // SetVar(SqlField,Ret(1)) \n)\n<\/xmp>');
t.xxtree42.add(291,59,'FillVar','Fills a variable with a value according to it\'s data type:\n<br />\nIt is mostly used for ENUM and FLAG types\n<br />\nExample:\n<pre>\nTac(\n SetVar(DataType,Cst(1002)),\n SetVar(Value,Cst(1)),\n \n FillVar(Libelle,DataType,Value),  // Now Libelle contains <img src="img/picto/13x13/cc.png" />\n FillPgmVar(Libelle,DataType,Value),  // Now $Libelle contains &lt;img src="img/picto/13x13/cc.png" /&gt;\n\n Ech(Var(Lib)),\n)\n<\/pre>\n');
t.xxtree42.add(362,59,'DataVal','<xmp>\nTac(\n SetVar(ExternalRule,DataVal(InternalRuleName,Data(1034))),\n SetVar(out,Var(out),sp(),Var(ExternalRule),Cst(\':\')),\n)\n<\/xmp>\n<\/xmp>');
t.xxtree42.add(318,42,'Nombres','');
t.xxtree42.add(319,318,'Formatter un nombre','To put a number in the local format, do:\n<xmp>\nTac(\n SetVar(Value,Cst(1234.567))\n SetVar(DisplayValue,Num(Value,3)), // Display value contains \n                                    // 1 234,567 in french format \n                                    // 1,234.567 in us format\n)\n\n<\/xmp>');
t.xxtree42.add(320,318,'Arrondir un nombre','<xmp>\nTac(\n SetVar(R,Cst(0))\n SetVar(Value,Round(Value,R))\n)<\/xmp>');
t.xxtree42.add(387,42,'tableaux','Contenu pour le chapitre tableaux');
t.xxtree42.add(388,387,'explode tab','<xmp>\nTac(\n SetVar(sep,Cst(\',\')),\n SetVar(value,Cst(\'hello,world\')),\n SetVar(myTab,explode(sep,value)),\n SetVar(Co,1),\n SetVar(myVal,tab(myTab,Co)), // myVal contains "world"\n)\n<\/xmp>');
t.xxtree42.add(64,42,'Contrôles et appels','');
t.xxtree42.add(65,64,'Test','Tests a contition to execute or not execute a treatment\n<xmp>\nTest(\n Cond(xxx),\n [IfTrue(yyy),]\n [IfFalse(zzz),] \n)\n<\/xmp>\n\nwhere xxx is the condition: It can be a function ( and usually is ). \n<br />\nyyy is the series of function to do if the condition returns true \n<br />\nzzzz is the series of function to do if the condition returns false \n<br />\nIf one or both of ReturnIfxxxx() are not mentioned, the returned value is true if the condition matches the ReturnIf ommitted. \n<br />\nExample 1: \n<xmp>\nSetVar(ValueToTest,1),\nTac(\n Var(ValueToTest),\n Test(\n  Cond(Equal(0)),  // the function Equal return true if the last value in varstack = it\'s argument.\n  IfFalse(\n   Msg(This will never be displayed but the program continues)\n  )\n )\n)\n<\/xmp>\n<br />\nThe Equal function can take as argument:\n<br />\na constant: can be a string or a number \n<br />\nVar(xxx): a variable whose name is xxx \n<br />\nf(): a function. \n\nExample 2: \n\n<xmp>\nSetVar(ValueToTest,Cst(1)),\nTac(\n Var(ValueToTest),\n Test(\n  Cond(Equal(1)),  \n  IfTrue(\n   Msg(I do not want to continue so I exit the program ),\n   ReturnFalse() // this instruction stops the program returning false\n  )\n )\n)\n\n<\/xmp>\nExample 3: \n<xmp>\nSetVar(ValueToTest,Cst()),\nTac(\n Var(ValueToTest),\n Test(\n  Cond(IsVoid()), \n  IfTrue(\n   Msg(I DO want to continue  ),\n  ),\n  IfFalse(\n   Msg(I DO NOT want to continue ),\n   Test(\n    Cond(Funct(123456)) // writes in errorlog something\n    IfTrue(\n     ReturnFalse() // if we can\'t write in error log, BIG ERROR\n    )\n   )\n  )\n )\n)\n<\/xmp>\nTest a function result:\n<xmp>\nTac(\n Var(TableCode),\n Var(FieldCode),\n Test(\n  Cond(Funct(Var(T0TestFunct))), // Var(T0TestFunct) contains the function number\n  IfTrue(\n   Tac(\n    // do something\n   )\n  )\n )\n)\n<\/xmp>');
t.xxtree42.add(66,64,'LoopVar','Loops n times a treatment.\n<xmp>\nLoopVar( \n xxxx,\n yyyy, \n Do(zzzz) \n)\n<\/xmp>\n\nwhere xxx is a variable containing the number of loops to do.\n<br />\nWhen the loop is executed, yyyy is set to the current loop number \n<br />\nzzzz is the series of functions \n<br />\n<br />\n\nExample: \n<xmp>\nSetVar(ValueToLoop,3),\nLoopVar(\n ValueToLoop,ind,\n Do(\n  SetVar(Message,Cst(\'hello world \'),Var(ind)),\n  Tac(\n   Var(Message),\n   out(1)         // outputs the 1st value in the call stack\n  )\n )\n)\n<\/xmp>\n\nthis loop displays hello, world 1 hello, world 2 hello, world 3 \n\n');
t.xxtree42.add(104,64,'SwitchCase','<br />\nCompares the last value in the call stack to some constants to execute functions\n<XMP>\nSwitchCase(\n x01,f01(),\n x02,f02(),\n .,\n .,\n .,\n [flast()]\n)\n<\/XMP>\nx0i are constants, f0i are functions\n<br />\nIf none of the constants are matched and there is NOT a last function, without a constant before, it returns false\n<br />\nIf none of the constants are matched and there IS a last function, without a constant before, it executes this last function\n<br />\nExamples:\n<XMP>\nTac(\n Cst(0),\n SwitchCase(\n  0,  out(OK),\n  1,  Tac(\n       DoManyThings(),\n       out(OK)\n      ),\n      out(KO) // default\n )\n)\n<\/XMP>\noutputs OK and continues\n<br />\n<br />\n<XMP>\nTac(\n Cst(2),\n SwitchCase(\n  0,  out(OK),\n  1,  out(OK),\n      out(KO)\n )\n)\n<\/XMP>\noutputs KO, and continues\n\n<br />\n<br />\n<XMP>\nTac(\n Cst(2),\n SwitchCase(\n  0,  out(OK),\n  1,  out(OK)\n )\n)\n<\/XMP>\nreturns false ( it\'s a bug because the case has not been considered  )\n\n<br />');
t.xxtree42.add(93,64,'Funct','<xmp>\nFunct(xxxx)\n<\/xmp>\nwhere xxxx is the number of the function to call\n<br />\nor xxxx = Var(yyyy) where yyyy is a variable that contains the function number to call');
t.xxtree42.add(94,64,'Comparaisons','Compares with the last value un the call stack\n<xmp>\nEqual(xxxx),\nEEqual(FALSE),EEQUAL(NULL) // does a type check ( === in php )\nGreater(xxxx),\nLower(xxxx),\nLowerEqual(xxxx)\nGreaterEqual(xxxx)\nIsVoid()\nIsNotVoid()\nIsNumeric()\n<\/xmp>\nwhere xxxx is a constant or xxxx = Var(yyyy)  \n<br />\nwith yyyy = variable name \n<br />\n<br />\nExample:\n<xmp>\nTac(\n SetVar(src,Cst(\'this is a . bug ;\')),\n// SetVar(src,Cst(\'$temp="This correct";\')),\n\n PhpTest(retour,src),\n\n Var(retour),\n Test(\n  Cond(EEqual(FALSE)),\n  IfTrue(\n   out(KO),\n   ReturnFalse()\n  ),\n  IfFalse(\n   out(<br /><br />OK)\n  )\n )\n)\n<\/xmp>\n\n\n');
t.xxtree42.add(73,42,'Fichiers','');
t.xxtree42.add(80,73,'a0_File','Opens and close a file after treatment. The syntax is: \n<pre>\na0_File( \n FileName(xxxx),\n FilePtr(yyyy),\n Action(z),\n Do(ffff())\n)\n<\/pre>\nwhere: \n<br />\nxxxx is a variable in the variable stack which contains the name of the function. \n<br />\nyyyy is a variable name which is created in the variable stack which will contain the name of the pointer to the file. This variable can be used in the ffff() function. \n<br />\nz : equals a ( append ) or w ( write ). \n<br />\nffff : is a function name to call. \n<br />\n<br />\n\nYou don\'t have to close the file, it is called when the function is finished. \n<br />\n\nExample: \n<pre>\n\nSetvar(MyFileName,VarG(xxPtaW),Cst(hello.htm)), // Fills the variable MyFileName with\n                                                          // the the file name\nSetVar(MyFileContent,Cst(Hello, world)), // Fills the File content\na0_File(\n FileName(MyFileName),\n FilePtr(MyFilePointer),\n Action(w),                                            // the file is [re]created\n Do(\n  a0_WriteVarStackInFile(MyFileContent,MyFilePointer)  // file is written\n )\n) // file is closed here\n\n<\/pre>\n');
t.xxtree42.add(87,73,'a0_WriteInFile','Writes the content of a variable in the variable stack into a file. \n<br />\nExample: \n<xmp>\nSetVar(FileName,Cst(\'helloworld.htm\')), \nSetVar(FileContent,Cst(\'hello, world\')), \na0_File(\n FileName(FileName),\n FilePtr(fp),\n Action(w),\n Do(\n  a0_a0_WriteInFile(FileContent,fp) \n ) \n) \n<\/xmp>\nthis writes a file "helloworld.htm" containing the string "hello world".\n<\/xmp>');
t.xxtree42.add(88,73,'a0_WriteInSourceFile','Writes the content of a variable in the variable stack into a file adding a Begin Php Tag at the begining of the file and a End Php Tag at the end of the file. \n<br />\nExample: \n<xmp>\nSetVar(FileName,Cst(\'helloworld.php\')), \nSetVar(FileContent,Cst(\' echo "hello, world\\\\n" ;\')), \na0_File( \n FileName(FileName), \n FilePtr(fp), \n Action(w), \n Do(\n  a0_WriteInSourceFile(FileContent,fp)\n ) \n), \n<\/xmp>\n<\/xmp>');
t.xxtree42.add(111,73,'a0_ReadFileInVarStack','Read the content of a file and put it in VarStack. The syntax is: \n<xmp>\na0_ReadFileInVarStack(\n xxxx,\n yyyy\n)\n<\/xmp>\nwhere \n<br />\nxxxx is the variable name which will contain the content of the file \n<br />\nyyyy is the variable name which contains the name of the file pointer \n<br />\nExample: To copy a file a into a file b, use this \n\n<xmp>\na0_File(\n FileName(SourceFile), // complete path \n FilePtr(sfp),\n Action(r),\n Do(\n  SetVar(FileContent,Cst()),\n  a0_ReadFileInVarStack(FileContent,sfp),\n  a0_File(\n   FileName(TargetFile), // complete path\n   FilePtr(tfp),\n   Action(w),\n   Do(\n    a0_WriteVarStackInFile(FileContent,tfp),\n   )\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(156,73,'a0_WriteInBinaryFile','Writes a file content as binary data, useful for copying images. \n<br />\nexample: Copy the content of img directory which contains images \n<xmp>\nSetVar(FilePath,VarG(xxPaWr),VarG(xxDatB),Cst(/img/)), \nSetVar(FileName,Cst(^.*$)), \nTac( \n Var(FilePath), \n Var(FileName), \n a0_DirList( \n  SetVar(FileName,3), \n  SetVar(FileSize,2), \n  SetVar(FileTime,1), \n  SetVar(SourceFileContent,Cst()), \n  SetVar(SourceFile,VarG(xxPaWr),VarG(xxDatB),Cst(/img/),Var(FileName)), \n  SetVar(TargetFile,VarG(xxPtaW),Cst(img/),Var(FileName)), \n  a0_File(\n   FileName(SourceFile),\n   FilePtr(SourceFp),\n   Action(rb),\n   Do( \n    a0_ReadFileInVarStack(SourceFileContent,SourceFp),\n    a0_File( \n     FileName(TargetFile),\n     FilePtr(TargetFp),\n     Action(wb),\n     Do(\n      a0_WriteInBinaryFile(SourceFileContent,TargetFp)\n     )\n    )\n   )\n  )\n )\n) \n<\/xmp>\n<\/xmp>');
t.xxtree42.add(81,73,'a0_Directory','Creates or delete a directory, the syntax is: \n<xmp>\na0_Directory(x,path)\n<\/xmp>\nWhere x = c ( create ) or d ( delete ). \n<br />\nand path is the variable containing the path of the directory\n<br />\nWhen the directory is deleted, all the files included are deleted but not the sub dir.\n<br />\n<br />\nExample\n<xmp>\nTac(\n SetVar(TargetBackup,VarG(xxPtaB),LowerCase(SystemDbToBackUp)),\n a0_Directory(c,TargetBackup),\n)\n<\/xmp>\n\n');
t.xxtree42.add(89,73,'a0_DeleteFile','deletes a file. \n<br />\nThe syntax is: \n<xmp>\na0_DeleteFile(xxxx) \n<\/xmp>\nWhere xxxx = Var(yyyy), yyyy is a variable contaning the name of the file to delete or xxxx = the name of the file ');
t.xxtree42.add(144,73,'a0_DirList','Puts in the call stack a list of files in a directory according to a file name ( ereg function ) <br />\nExample: to list the skin files, the function used in MyPitSelf is: \n<xmp>\nSetVar(FilePath,Cst()),                 // The path is void ( current path )\nSetVar(FileName,Cst(^styles.*\\php$)),   // file name looks like styles_*.php\nTac(\n Var(FilePath),\n Var(FileName),\n SetVar(CurrentSkin,Display(1000063),VarG(xxUserSkin),Cst(<br />)),\n Ech(Var(CurrentSkin)),  // the current skin is:\n a0_DirList(\n  SetVar(FileName,3),\n  SetVar(FileSize,2),\n  SetVar(FileTime,1),\n\n  SetVar(Button,Funct(239)),  \n  Tac(                             \n   Var(FileName),       \n   Cst(1),               \n   Cst(OPTION),         // CLASS of the button\n   Cst(.),              // Image \n   Var(FileName),       // TITLE (Tool tip of the button)\n   Var(FileName),       // text displayed on the button\n   Var(Button),         // Function number to call\n   Funct(1001),         \n   SetVar(Button1,1,Cst(<br /><br />)),   // Put the html code in a variable to display it\n  ),\n  Ech(Var(Button1))     // displays the button\n )\n)\n<\/xmp>\n\n');
t.xxtree42.add(255,73,'a0_DirDirList','List directories of a directory.\n<br />\nExample: The .css files are created in the MyPitSelf environment. After their creation, they must be copied in the other programs so this function is used:<xmp>\nTac(\n\n SetVar(DirPath,VarG(xxPaWr)),\n SetVar(Patern,Cst(\'^.*$\')),\n\n Var(DirPath),\n Var(Patern),\n a0_DirDirList(\n  SetVar(DirName,2),\n  SetVar(DirTime,1),\n  Tac(\n   Var(DirName),\n   Test(\n    Cond(Equal(VarG(xxVers))),\n    IfFalse(\n     Tac(\n      SetVar(FromDir,VarG(xxPaWd),Cst(\'img/\')),\n      SetVar(ToDir,VarG(xxPaWr),Var(DirName),Cst(\'/img/\')),\n\n      SetVar(FileName,Cst(\'^a0_styles_[0-9]*\\\\..*s$\')), // .js or .css\n\n      Cst(0),        // silent does not echo the copy if 1\n      Var(FromDir),\n      Var(ToDir),\n      Var(FileName),\n      a0_CopyFileDir(),\n\n     )\n    )\n   )\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(256,73,'a0_CopyFileDir','Copy file matching a given pattern from a directory to an other one.\n<br />\nExample: The .css files are created in the MyPitSelf environment. After their creation, they must be copied in the other programs so this function is used:\n<xmp>\nTac(\n\n SetVar(DirPath,VarG(xxPaWr)),\n SetVar(Patern,Cst(\'^\'),VarG(xxVers),Cst(\'.*$\')),\n\n Var(DirPath),\n Var(Patern),\n a0_DirDirList(\n  SetVar(DirName,2),\n  SetVar(DirTime,1),\n  Tac(\n   Var(DirName),\n   Test(\n    Cond(Equal(VarG(xxVers))),\n    IfFalse(\n     Tac(\n      SetVar(FromDir,VarG(xxPaWd),Cst(\'img/\')),\n      SetVar(ToDir,VarG(xxPaWr),Var(DirName),Cst(\'/img/\')),\n\n      SetVar(FileName,Var(ToDir),Cst(\'mps_style_*.*\')), \n      a0_DeleteFile(Var(FileName)), \n\n      SetVar(silent,Cst(0)),        // silent does not echo the copy if 1\n\n      SetVar(FileName,Cst(\'^mps_style_.*s$\')), // .js or .css\n      a0_CopyFileDir(FileName,FromDir,ToDir,silent),\n\n      // ..... etc\n\n     )\n    )\n   )\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(368,73,'FileExist','Check if a file exist, must be put in a test\n\n<xmp>\n SetVar(FileName,Cst(\'file/\'),Var(T0name),Cst(\'.png\')),\n Var(FileName),\n Test(\n  Cond(FileExist()),\n  IfTrue(\n   Tac(\n   )\n  ),\n  IfFalse(\n   Tac(\n   )\n  )\n ),\n   \n<\/xmp>');
t.xxtree42.add(74,42,'Fonctions interactives','');
t.xxtree42.add(77,74,'a0_list','Displays a list of values obtained from an SQL request. \n<br />\nThe syntax is \n<xmp>\na0_list( \n Sql(xxxx), \n [ShowVar(zzzz),] \n [FieldToUpdate(iiii),FieldToSee(jjjj),] \n [Header(Funct(kkkk)),Line(Funct(llll)),]\n [NoCounter(),] \n [Hidden(Var(mmmm)),] \n [Range(Var(nnnn))]\n) \n<\/xmp>\nwhere xxxx is the number of the sql request. It must be a SELECT LIST type. \n<br />\n<br />\nzzzz is a variable which contains a string to display \n<br />\n<br />\na0_list is also used when there is a value to fetch in an other table ( see the XREF functions ). \nIn that case iiii is the name of the field to fetch ( generally, T0.ID ) \n<br />\njjjj is the name of the field to see ( generally T0.Name ) \n<br />\n<br />\n\nkkkk is the number of a MyPitSelf function called to output the line header of the table \n<br />\nllll is the number of a MyPitSelf function called to output each line \n<br />\nnnnn is the number of a MyPitSelf function before displaying the list \n<br />\noooo is the number of a MyPitSelf function after displaying the list \n<br />\nnnnn is the first line to display\n<br />\n<br />\n<b>Important point begin:<\/b>\n<br /> A request for a list has generally some input criterias. \nThe todo request for example is \n<xmp>\nSELECT T0.Code,T0.Priority,T0.Name,T0.TimeStampCreate,T0.TimeStampUpdate \nFROM   $xxDatB.yTodo T0 \nWHERE T0.User = %SQLPAR0% and T0.Priority >= %SQLPAR1% and \n      ucase( T0.Name ) LIKE ucase( \'%yDoc%\' ) and T0.Code <= %SQLPAR3% \nORDER BY T0.Priority ASC , T0.Code DESC LIMIT 30 \n<\/xmp>\nThe values %SQLPARn% are the input criterias for the todo list. \nThese values must be put in the call stack before the call to a0_list and you must add the number of parameters of the request as the last value in the call stack. \n<br />\n<br />\nExample: for the request 1001, the use of this function is: \n<xmp>\nTac( \n Var(xxUserCode), // parameter 1: user code ( %SQLPAR0% ) \n Cst(0),           // parameter 2: priority ( %SQLPAR1% ) \n Cst(),            // parameter 3: content of the todo ( yDoc ) \n Cst(999999999999999999), // parameter 4: code of the todo ( %SQLPAR3% ) \n Cst(4),           // There are 4 parameters. \n a0_list( \n  Sql(101)\n ) \n) \n<\/xmp>\n<b>Important point end: <\/b>\n<br />\n<br />\nSome properties for a request list type can be added, they are:\n\n <TABLE cellpadding="1" cellspacing="1" border="1">\n      <TR class="RECORD">\n        <TD class="RECORD">\n          SELECT DISTINCT\n        <\/TD>\n        <TD class="RECORD">\n          add a "DISTINCT" in front of the select\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          LIST LIMIT\n        <\/TD>\n        <TD class="RECORD">\n          Fixees the number of record to be output\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          Line height\n        <\/TD>\n        <TD class="RECORD">\n          Line height in pixel of the list\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          Cell padding\n        <\/TD>\n        <TD class="RECORD">\n          Cell padding in pixelx of the values in the list\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          OPTION COLUMN WIDTH\n        <\/TD>\n        <TD class="RECORD">\n          width of the column that contains the option buttons\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          Do not put the list in a table\n        <\/TD>\n        <TD class="RECORD">\n          Normally, a list is put in a table, setting this flag to 1 prevents it.\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          GoTo buttons in a list\n        <\/TD>\n        <TD class="RECORD">\n          Add one more access <img src="img/picto/13x13/p.png"> buttons in a list\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          Line function\n        <\/TD>\n        <TD class="RECORD">\n          Reference of the line function to use to display the data\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          Header function\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          NoMenu\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          Before list function\n        <\/TD>\n      <\/TR>\n      <TR class="RECORD">\n        <TD class="RECORD">\n          After list function\n        <\/TD>\n      <\/TR>\n    <\/TABLE>\n\n\n<xmp>\nSetVar(ToDisplay,VarG(xxxHeader)), \nTac(\n Var(ToDisplay),\n Cst(<), CutWithoutLastCharEqual(), // take off <\/td>\n SetVar(ToDisplay,1,Cst(<td>Stack<\/td><\/tr>)),\n Ech1(Var(ToDisplay))\n)\n<\/xmp>\nAn example of a Line function is\n<xmp>\nTac( // Line function of list of 1453\n\n SetVar(Option,VarG(xxxOptionLine)),\n \n SetVar(Button,Funct(5574)), \n VarG(T0Code),\n Cst(1),\n Cst(.),              // CLASS \n Cst(u.gif),          \n Display(2000215),\n Display(2000214),    // text displayed on the button\n Var(Button),         \n Funct(1001),\n SetVar(Option,Var(Option),1),\n\n SetVar(ToDisplay,VarG(xxxStartLine),Var(Option),Cst(<\/td>),VarG(xxxValueLine),Cst(<\/tr>)),\n Ech1(Var(ToDisplay))\n),\n<\/xmp>\n<br />\n<br />\nNoCounter() : The <img src="img/picto/13x13/au.png" /> and <img src="img/picto/13x13/ad.png" /> buttons to see the next records and the counter (xxx->yyyy)/zzz on the top of the list are not displayed \n<br />\n<br />\nHidden(Var(mmmm)) : A variable is put in the Variable stack with the name xxx \n<br />\n<\/xmp>');
t.xxtree42.add(78,74,'a0_Screen','<br />\nDisplay a record on the screen for Create, View, Update or duplicate.\n<br />\nThe syntax is\n<XMP>\na0_Screen(\n Mode(xxxx),\n Sql(yyyy),\n [ShowVar(zzzz),]\n [After(Funct(iiii))|ScreenAfter(Funct(iiii),]\n [Replace(T0.jjjj,Var(kkkk)),]\n [NoLock(),]\n [NoLog(),]\n [Under(Funct(llll))]\n)\n<\/XMP>\nwhere\n<br />\nxxxx = Create or View or Update or Duplicate: Action to do with the record\n<br />\nyyyy = the sql number to use\n<br />\nzzzz = name of the variable containing a string to display\n<br />\niiii = Function number to call after an Update, a Duplicate or a Create.\n<br />\nThe difference between After() and ScreenAfter is the type of the function iiii.\n<br />\nThe ScreenAfter function usually ask some data .\n<br />\nExample:\n<br />\n\nWhen the super user creates a new user, the next screen that comes after the "CREATE" button is the one that ask the user password which is function # 4021, so it gives:\n\n<xmp>\na0_Screen( \n Mode(Create), \n Sql(1014), \n ScreenAfter(Funct(4021))\n)\n<\/xmp>\n\n<br />\njjjj,kkkk if some fields are hidden in the Sql request, this lets you fill the field with a value.\n<br />\nNoLock(): Usually, an update must lock the record so that someone else can\'t modify it. But in certain cases, the lock is not wanted.\n<br />\nNoLog(): Usually, a View option is logged in the system so that when you click on the Back button, you can see the screen again. But, in certain cases, the loggin must not be done so you can use this verb.\n<br />\nUnder(Funct(llll)): where llll is a function number: If the Mode() type is update or View, llll represents a function that is called after displaying the screen. This last function receives as a parameter the ID of the record being displayed.\n<br />\n<br />\nThe values of the parameters must be pushed in the call stack before this call.\n<br />\n<br />\n<br />\nExample: the request (1002) to get a todo record by Code is:\n<XMP>\nSELECT  T0.Code,T0.Priority,T0.Name   \nFROM \n $xxDatB.yTodo T0 \nWHERE \n T0.Code = %SQLPAR0%\n<\/XMP>\nNote that the T0.Code, the auto incremented field is hidden ( go to the <A CLASS=ACTION>Request<\/A> menu for select 1002, click on the <A CLASS=OPTION>Fields<\/A> button, and <A CLASS=OPTION>View<\/A> the T0.Code Field ).\n<br />\nSo the creation of a todo record looks like:\n<XMP>\na0_Screen( \n Mode(Create),\n Sql(1002)\n)\n<\/XMP>\n<br />\nThe update of a todo record looks like:\n<XMP>\nTac(\n Field(T0.Code),        // first and only parameter of the request\n a0_Screen( \n  Mode(Update),\n  Sql(1002),\n  NoLock()\n )\n)\n<\/XMP>\n<br />\nNote: If a function is attached to the main table of the request then this function is called before the Update/create/Duplicate of the record.\n<br />\n<br />\nThe fields in these functions are available as VarG ( global variables ) and are referenced as TnFieldName WITHOUT a . between Tn and FiendName. \n<br />\nThis comes because it\'s the value from the screen which is tested and not the value from the table.\n<br />\n<br />\nSee the TABLETEST functions for more examples.\n\n\n');
t.xxtree42.add(75,74,'a0_AskData','Interactive input ask to the user\n<br />\nSyntax:\n<XMP>\na0_AskData(\n [Display(xxxx),]\n LaunchButton(Display(ZZZZZZ)),\n Par(yyyy,zzzz,Default(Var(kkkk)),OnUpdate(Funct(1234)),[,,,]\n [LaunchButton(llll),|NoLaunchButton()] \n Tac(\n  SetVar(Value0,Input(0)),[,,,]\n  ffff()\n )\n)\n<\/xmp>\nwhere\n<br />\nxxxx: can be a number and it displays the message number xxxx or Var(VariableName) ant it displays the content of the variable VariableName\n<br />\n<br />\nllll = Display(iiiii) or Var(eeeee) to display a different text on the launch button than "GO"\n<br />\n<br />\nyyyy: a string and if equals to Display(nnnn) it displays the message number nnnn\n<br />\n<br />\nzzzz: either Data(iiii) where iiii is a number of a data in the <A CLASS=ACTION>Data<\/a> menu\n<br />\nor a function to get the value from a table like \n<XMP>\nTac(\n Cst(i),[,,,] Cst(j),\n a0_list(\n  Sql(llll),\n  FieldToUpdate(T0.FieldToUpdate),\n  FieldToSee(T0.FieldToSee)\n )\n)\n<\/xmp>\n(see the a0_list function for the syntax )\n<br />\n<br />\nkkkkk is the name of a variable for an initial value\n<br />\n<br />\nTo get the parameters entered, use the syntax:\n<xmp>\nSetVar(Par0,Input(0)),\nSetVar(Par1,Input(1)),\n....\n<\/xmp>\nSee below for an example.\n<br />\n<br />\nThis command can also be used to upload a file. In this case, 5 parameters are filled.\n<br />\nExample:\n<xmp>\nSetVar(idRoot,1),\na0_AskData(\n Display(2000409),\n Par(  Display(2000320),  Upload() ),\n Tac(\n  SetVar(FileName,Input(0)),\n  SetVar(FileType,Input(1)),\n  SetVar(FileTmp,Input(2)),\n  SetVar(FileSize,Input(3)),\n  SetVar(FileErr,Input(4)),\n  Var(FileErr),\n  Test(\n   Cond(Equal(0)), // no error\n   IfTrue(\n    Tac(\n     Var(FileSize),\n     Test(\n      Cond(Lower(5000000)),\n      IfTrue(\n       // do stuff\n      ),\n      IfFalse(\n       out(file greater than 5000000)\n      )\n     )\n    )\n   )\n  )\n )\n)\n<\/xmp>\n\na big example I use for my own tests is:\n<xmp>\nSetVar(MonTest,Cst(\'<b>hello, world<\/b>\')),\nSetVar(hidd,Cst(1)),\nSetVar(show,Cst(0)),\nSetVar(MyDataType,Cst(14)),\na0_AskData(\n Display(2000276),\n LaunchButton(Display(2000340)),\n Par(Display(2000292),Data(Var(MyDataType)),Default(Cst(9999-12-31)),Hide(Var(show))),\n Par(Display(2000292),Data(21),Default(Cst(12:00:00)),Hide(Var(hidd))),\n Par(\n  Display(2000292),\n  Tac( \n   Cst(),Cst(INTEGER),Cst(0),Cst(9999-12-31),Cst(23:59:59),\n   VarG(xxDefValDateTime),Cst(9999999),\n   Cst(7),\n   a0_list(\n    Sql(1526),\n    FieldToUpdate(T0.ID),\n    FieldToSee(T0.Text)\n    Data(22)\n   )\n  ),\n  Default(Cst(0)),\n  Hidden(Var(show)),\n ),\n Par(Display(2000292),Data(25),Default(Var(MonTest))), // html type\n Par(Display(2000292),Data(27),Default(VarG(xxDefValTimeStamp))),\n Par(Display(2000292),Data(9), Default(VarG(xxDefValDateTime))),\n Par(Display(2000292),Data(2), Default(Cst(1))),\n Par(Display(2000292),Data(26),Default(Cst(1235.02003))),\n Par(Display(2000292),Data(20),Default(Cst(1235.02))),\n Par(Display(2000292),Data(1002)),\n Par(Display(2000292),Data(1015)),\n Tac(\n  out(liste des valeurs egal),\n  out(11), out(10), out(9), out(8), out(7), out(6), out(5), out(4), out(3), out(2), out(1)\n )\n)\nTac(\n Var(xxxShowForm),\n Test(\n  Cond(Equal(1)),\n  IfTrue(\n   Tac(\n    // if form display\n   )\n  )\n )\n)\n<\/xmp>\n<\/xmp>');
t.xxtree42.add(76,74,'out, Display, Ech','out(n)            // outputs the n\'iest last value in the call stack ( for debug purposes )\n<br />\nout(bla bla)      // outputs bla bla\n<br />\nout()             // outputs a line break\n<br />\nShowMsg(n)        // outputs the message number n.\n<br />\nEch(Var(MyVar))   // outputs the string contained in MyVar in span LISTTITLE attribute.\n<br />\nEch1(Var(MyVar))  // outputs the string contained in MyVar without any HTML attribute.\n<br />\nExample, let\'s suppose that msg # 1000011 contains "hello, world"\n<xmp>\nTac(\n Cst(Hello),\n Cst(world),\n out(2),            // outputs Hello\n out(1),            // outputs world\n out(hello world)   // outputs hello world\n ShowMsg(1000011)   // outputs Hello\n SetVar(TheMessage,Display(1000011)),\n Ech(Var(TheMessage)), // outputs Hello, world\n)\n<\/xmp>\n');
t.xxtree42.add(86,74,'nap','Delays the execution of the outputs of n seconds.\n<br />\nSyntax:\n<xmp>\nTac(\n Cst(Wait for 2 seconds please), // message displayed\n out(1),\n Nap(2)  // 2 seconds \n)\n<\/xmp>');
t.xxtree42.add(101,74,'Back, Home','<br />\nBack(n) // Return to the n\'iest previous screen. \n<br />\nHome()  // go to the Home screen\n<br />\n');
t.xxtree42.add(241,74,'menu','Displays the menu \n<br />\nFor the Example: to display the documentation chapters in MyPitSelf, the function starts with \n<xmp>\nTac(\n menu(),\n LogTheCall(),\n SetVar(NbTotChap,Cst(0))\n R_1798_Select(\n  Do(\n   Take(T0.Code),\n   AddVar(NbTotChap,Cst(1))\n  )\n ),\n ....\n)\n<\/xmp>\nThis function is usually used with the LogTheCall() function');
t.xxtree42.add(240,74,'LogTheCall','Usually, the calls to the functions happen only in list functions. But sometimes the menus call functions that are not lists.\n<br />\nIf you wish to use the backs button in this case, use this function.\n<br />\nExample: to display the documentation chapters in MyPitSelf, the function 6770 starts with\n<xmp>\nTac(\n menu(),\n LogTheCall(),\n SetVar(NbTotChap,Cst(0))\n R_1798_Select(\n  Do(\n   Take(T0.Code),\n   AddVar(NbTotChap,Cst(1))\n  )\n ),\n ....\n)\n<\/xmp> \n\nThis function is usually used withs the menu() function');
t.xxtree42.add(95,42,'Chaînes de caractères','');
t.xxtree42.add(326,95,'Conversion de chaines','As we use HTML, PHP, JavaScript containing HTML or Javascript containing Alert() function, many cases are\npossible because the string delimiter, the carriage return, the ditable fields can contain many cases.\n<br />\nKeep in mind that the string delimiter in MyPitSelf is \'.\n<br />\nThe \' can be put in a string using \\\'.\n<br />\nThe \\ can be put in a string using \\\\.\n\n');
t.xxtree42.add(285,326,'ToHTML','Converts the content of a variable to htlm characters\n<xmp>\nTac(\n SetVar(MyVar,Cst(\'<br />hello\')),\n SetVar(MyHtm,ToHTML(MyVar)), // contains & lt ; br & gt ; hello\n)\n<\/xmp>');
t.xxtree42.add(322,326,'ToJsAlert','Converts a string to a string that can be the content of a javaScript alert message.\n<br />\nThe line feed (lf) is converted to the \\n\n<br />\nThe carriage return ( cr ) is converted to nothing\n<br />\nthe \\ is converted to \\\\\n<br />\nthe \' is converted to \\\'\n<xmp>\nR_1585_Select(\n Do(\n  Take(T0.Value),\n  SetVar(Val,1),\n  SetVar(JsFileContent,Cst(\' Alert(\\\'\'),ToJsAlert(Val),Cst(\'\\\');\\n\'))\n )\n)\n<\/xmp>');
t.xxtree42.add(321,326,'ToJsHtml','Converts a string to a string that can be the content of a javaScript variable.\n<br />\nThe line feed (lf)  is converted to the BR tag\n<br />\nThe carriage return (cr)  is converted to nothing\n<br />\nthe \\ is converted to \\\\\n<br />\nthe \' is converted to \\\'\n<xmp>\nR_1585_Select(\n Do(\n  Take(T0.Value),\n  SetVar(Val,1),\n  SetVar(JsFileContent,Cst(\' var MyJsVariable=\\\'\'),ToJsHTML(Val),Cst(\'\\\';\\n\'))\n )\n)\n<\/xmp>');
t.xxtree42.add(323,326,'ToHtmlEdit','Converts a string to an html edit\n<br />\nthe carriage return is converted to nothing,\n<br />\nthe line feed (lf) is converted to & # 10 ;,\n<br />\nthe \'  is converted to & # 39 ;,\n<br />\nthe \\  is converted to & # 92 ;,\n<xmp>\nTac(\n SetVar(T0Value,ToHtmlEdit(T0Value))\n)\n<\/xmp>');
t.xxtree42.add(340,326,'ToQuotes','Converts a string with\n<br />\n\\  is converted to \\\\,\n<br />\n\'  is converted to \\\',\n<xmp>\nTac(\n SetVar(T0Value,ToQuotes(T0Value))\n)\n<\/xmp>');
t.xxtree42.add(286,326,'FunctionEntities','Converts a string to a Constant.\n<br />\nExample: in the Tool menu, the function that converts a string is:\n<xmp>\nMenu(), //Convert to function\na0_AskData(\n Par(Display(2000121),Data(6)),\n Tac(\n  SetVar(Original,Input(0)),\n  SetVar(Original,FunctionEntities(Original)),\n  \n  SetVar(out,Cst(\'<pre>Cst(\\\'\'),Var(Original),Cst(\'\\\')<\/pre>\')),\n  Ech1(Var(out)),\n )\n)\n<\/xmp>\nSo if in input there is ( there is a line feed at the end )\n<br />\n<br />\n<xmp>hello, \'world\', with " and ( and \' \n<\/xmp>\n<br />\nin output we have this\n<br />\n<br />\nCst(\'hello, \\\'world\\\', with " and ( and \\\' \\n\')\n');
t.xxtree42.add(97,95,'Match','<br />\nDoes an ereg() on the last value in call stack\n<br />\nSyntax:\n<br />\nMatch(xxxx)\n<br />\nwhere xxxx is the ereg string \n<br />\nFor example, to test that a new password is correct, MyPitSelf uses the function\n<XMP>\nSetVar(NewPassword,2),\nSetVar(NewPasswordConfirm,1),\nTest(              // is the new password = confirmation ( passwords have to be entered twice )\n Cond(Equal(Var(NewPassword))), \n IfFalse(ShowMsg(1000009),ReturnFalse())\n),\nTest(\n Cond(Match(\'^([a-zA-Z0-9]{6,32})$\')) // contains only alpha\n IfFalse(\n  ShowMsg(1000010),ReturnFalse()\n )\n)\n<\/XMP>');
t.xxtree42.add(103,95,'CutWithLastChar','<br />\nCutWithLastChar(MyVar,Var(Value),Cst(\',\')), \n<br />\nCut the value from the last position+1 founded of the third parameter ( Cst(\',\') here ) in value to the end and puts the result in MyVar.\n<br />\nExample\n<XMP>\nTac(\n\n SetVar(DataValueList,Cst(\'a, b , c , bla bla \')),\n\n CutWithLastChar(DataValueList,Var(DataValueList),Cst(\',\')), \n\n Ech1(Var(DataValueList)) // outputs "a, b , c ,"\n\n)\n<\/XMP>\n\n');
t.xxtree42.add(120,95,'CutWithoutLastChar','<br />\nCutWithoutLastChar(MyVar,Var(Value),Cst(\',\')), \n<br />\nCut the value from the last position founded of the third parameter ( Cst(\',\') here ) in value to the end and puts the result in MyVar.\n<br />\nExample\n<XMP>\nTac(\n\n SetVar(DataValueList,Cst(\'a, b , c , bla bla \')),\n\n CutWithoutLastChar(DataValueList,Var(DataValueList),Cst(\',\')), \n\n Ech1(Var(DataValueList)) // outputs "a, b , c "\n\n)\n<\/XMP>\n\n');
t.xxtree42.add(114,95,'CutString','Cut the value in call stack from a position ( starts with 0 ) for a length \n<br />\nExample\n<XMP>\nTac(\n SetVar(FieldList,Cst(,toto,tata,titi))\n SetVar(FieldList,CutString(FieldList,1,1000)),  // now contains toto,tata,titi\n\n SetVar(FieldList,Cst(toto,tata,titi,))\n SetVar(FieldList,CutString(FieldList,0,-1)),  // now contains toto,tata,titi\n\n)\n<\/XMP>\n\nor\n\n<xmp>\n SetVar(x,VarG(xxPaWr)),\n SetVar(x,Len(x)),\n\n SetVar(Path,VarG(xxPtaI)),\n SetVar(Path,Cst(\'../\'),CutString(Path,Var(x),1000)),\n\n<\/xmp>\n<\/xmp>');
t.xxtree42.add(135,95,'Lower or upper case','Example:\n<XMP>\nTac(\n //==================== LowerCase ============\n SetVar(str,Cst(HeLLo)),\n SetVar(str,LowerCase(str)) // contains hello\n\n // or\n\n SetVar(str,Cst(HeLLo)),\n Var(str),\n SetVar(str,LowerCase(1)) // contains hello\n\n // or\n\n SetVar(str,LowerCase(VarG(xxxVarGvalue))) \n\n //==================== UpperCase ============\n SetVar(str,Cst(HeLLo)),\n SetVar(str,UpperCase(str)) // contains HELLO\n\n // or\n\n SetVar(str,Cst(HeLLo)),\n Var(str),\n SetVar(str,UpperCase(1)) // contains HELLO\n\n // or\n\n SetVar(str,UpperCase(VarG(xxxVarGvalue))) \n)\n<\/XMP>');
t.xxtree42.add(145,95,'ReplaceString','ReplaceString: replace a string with an other in a string\n<br />\nExample:\n<XMP>Tac(\n Cst(:),\n Chr(32),\n Var(FileName),\n ReplaceString(),          // replace ":" with " " in last value in stack\n SetVar(FileName,1)\n)\n<\/XMP>\n');
t.xxtree42.add(146,95,'RepPreg','RepPreg: replace a string with an other in a string using the preg specification\n<br />\nExample:\n<XMP>Tac(\n SetVar(Content,Cst(\'MyFunct(hello)\')), \n SetVar(Replace,Cst(\'/MyFunct\\\\((\\\\w*)\\\\)/\')),\n SetVar(With,Cst(\'<A HREF="javascript:popup(\\\'\\\\\\\\1\\\')"><img src=img/sc.gif border=0><\/a>\')),\n\n RepPreg(Replace,With,Content),\n)\n<\/XMP>');
t.xxtree42.add(236,95,'StringIsInString','Return true if a string is found in an other string\n<br />\nExample:\n<xmp>\nTac(\n SetVar(ToSearch,Cst(\'-\'),Var(Parent),Cst(\'-\')),\n Var(ToSearch),\n Var(DocList),\n Test(\n  Cond(StringIsInString()),\n  IfTrue(\n   // do the job\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(367,95,'strpos, strrpos','Returns the position of a string in an other string, strrpos starts the research from the end of the string\n<xmp>\n SetVar(ToSearch,Cst(\'/\')),\n Var(ToSearch),\n Var(T0NewValue),\n Test(\n  Cond(StringIsInString()),\n  IfTrue(\n   SetVar(pos,strpos(T0NewValue,ToSearch)) // pos contains the position of the string to search.\n  )\n )\n<\/xmp>');
t.xxtree42.add(351,95,'ToArray','<xmp>\nTac(\n // ElementName contains \'123-456\n ToArray(RuleType,ElementName,Cst(-)),  // RuleType contains now Array(\'123\',\'456\')\n)\n<\/xmp>');
t.xxtree42.add(239,95,'Len','Returns the lenght of the string\n<br />\nExample: To show the database schema:\n<xmp>\n SetVar(x,VarG(xxPaWr)),\n SetVar(x,Len(x)),\n\n SetVar(Path,VarG(xxPtaI)),\n SetVar(Path,Cst(\'../\'),CutString(Path,Var(x),1000)),\n\n<\/xmp>\n');
t.xxtree42.add(324,95,'H2D','Converts an hexadecimal string to a decimal string\n<xmp>\nTac(\n SetVar(MyVar,Cst(\'FF\')),\n SetVar(MyVar,H2D(MyVar)), // Now, MyVar is 255\n)\n<\/xmp>');
t.xxtree42.add(344,95,'BranchHeader()','Creates a head string for the trees.\n<xmp>\nTac(\n SetVar(Level,Cst(5)), // level can be 0\n SetVar(out,BranchHeader(Level))\n Ech1(Var()), outputs \'<tr class=""><td><img width={level}"> \'\n}\n<\/xmp>');
t.xxtree42.add(345,42,'Html','Some various JS/Html functions.');
t.xxtree42.add(370,345,'span','Contenu pour le chapitre span');
t.xxtree42.add(348,370,'span','Puts a value in a span \n<xmp>\nTac(\n SetVar(ToSearch,Cst(\'-\'),Var(DocDisp),Cst(\'-\')),\n Var(ToSearch),\n Var(DocHiLight),\n Test(\n  Cond(StringIsInString()),\n  IfTrue(\n   SetVar(Name,span(ECHO,Name)) // $Name=\'<span class="ECHO">\'.$Name.\'<\/span>\';\n  )\n ),\n)\n<\/xmp>\n\nor declare a span with an ID\n<xmp>\n SetVar(Name,SpanId(MYSPAN,ECHO)) // $Name=\'<span id="MYSPAN" class="ECHO"><\/span>\';\n<\/xmp>\n\nor declare a span with an ID as variable with or without a class\n<xmp>\nSetVar(Ms,Cst(\'createFields_\'),Var(TableCode)),\nSetVar(out,SpanVar(Ms),Var(BAll),SpanEnd()),  // $Out=\'<span id="\'.$Ms.\'">\';\nor\nSetVar(out,SpanVar(Ms,ZZHID),Var(BAll),SpanEnd()),  // $Out=\'<span id="\'.$Ms.\'" class="ZZHID">\';\n<\/xmp>\n\nor declare a span with an ID and a style\n<xmp>\nSpanStyle(SvgC,display:inline;), // $Out=\'<span id="SvgC" style="display:inline;">\';\n<\/xmp>\n\nor declare a span with a class\n<xmp>\nSpanClass(ECHO), // $Out=\'<span class="ECHO">\';\n<\/xmp>\n\nor declare a span START with an ID\n<xmp>\n SetVar(Name,SpanIdSt(MYSPAN,ECHO)) // $Name=\'<span id="MYSPAN" class="ECHO">\';\n// or\n SetVar(Name,SpanIdSt(MYSPAN)) // $Name=\'<span id="MYSPAN">\';\n<\/xmp>\n\nor declare a span End\n<xmp>\n SetVar(Name,SpanEnd()) // $Name=\'<\/span>\';\n<\/xmp>');
t.xxtree42.add(347,370,'HiddenSpan','Put the content of stack in a hidden span.\n<br />\nSetvar(aVariable,HiddenSpan(SPANNAME,i)),\n<br />\ni is the stack position of the element to put in the span\n\n<br />\nexample:\n\n<xmp>\nTac(\n SetVar(Button,Funct(6202)),\n Cst(0),\n Cst(.),\n Cst(p.gif), \n Display(2000079),\n Display(2000079),\n Var(Button),\n Funct(1001),\n SetVar(Button,HiddenSpan(BOT1,1)),\n Ech1(Var(Button)),\n CopySpan(BOT1,AFTERFUNCTIONLIST), // or AFTERLISTTITLE for example\n)\n<\/xmp>');
t.xxtree42.add(346,370,'CopySpan','Copy the content of a span to an other.\n<xmp>\nTac(\n SetVar(Button,Cst(\'<span id="BOT1" style="display:none">\'),1,Cst(\'<\/span>\')),\n Ech1(Var(Button)),\n CopySpan(BOT1,AFTERLISTTITLE),\n)\n<\/xmp>\nOr\n<xmp>\nTac(\n SetVar(Spa01,Cst(BOT1)),\n SetVar(Spa02,Cst(AFTERLISTTITLE)),\n SetVar(Button,Cst(\'<span id="BOT1" style="display:none">\'),1,Cst(\'<\/span>\')),\n Ech1(Var(Button)),\n CopySpan(Var(Spa01),Var(Spa02)), // copy Spa01 in Spa02\n)\n<\/xmp>\n<\/xmp>');
t.xxtree42.add(349,370,'ClearSpan','Puts nothing in a span\n<xmp>\n ClearSpan(MYSPAN), //document.getElementById("MYSPAN").innerHTML="";\n<\/xmp>');
t.xxtree42.add(350,370,'HideSpan','Hide the content of a span \n<xmp>\nTac(\n SetVar(SpNa,Cst(\'SPLO\'),Var(Id)),\n HideSpan(SpNa),\n // echo \'<'+'script>document.getElementById("\'.$SpNa.\'").style.display="none";<'+'/script>\';\n\n HideParentSpan(SpNa),\n // echo \'<'+'script>this.parent.document.getElementById("\'.$SpNa.\'").style.display="none";<'+'/script>\';\n\n)\n<\/xmp>\n<\/xmp>');
t.xxtree42.add(378,345,'div','Contenu pour le chapitre div');
t.xxtree42.add(379,378,'div','Declare a div with an ID and a style\n<xmp>\nDivStyle(SvgC,display:inline;), // $Out=\'<div id="SvgC" style="display:inline;">\';\n<\/xmp>\n<br /><br />\nor declare a div End\n<xmp>\n SetVar(Name,DivEnd()) // $Name=\'<\/div>\';\n<\/xmp>\n<\/xmp>');
t.xxtree42.add(372,345,'table','Contenu pour le chapitre table');
t.xxtree42.add(373,372,'table0','use as : SetVar(temp,table0()), Ech1(var(temp)),\nequivalent to \n<pre>\n&lt;table border="0" cellpadding="0" cellspacing="0" summary="">\n<\/pre>');
t.xxtree42.add(374,372,'table1','use as : SetVar(temp,table0()), Ech1(var(temp)),\nequivalent to \n<pre>\n&lt;table border="0" cellpadding="0" cellspacing="0" summary="" align="left">\n<\/pre>');
t.xxtree42.add(375,372,'tr0','use as : SetVar(temp,tr0()), Ech1(var(temp)),\nequivalent to \n<pre>\n&lt;tr>\n<\/pre>');
t.xxtree42.add(376,372,'td0','use as : SetVar(temp,td0()), Ech1(var(temp)),\nequivalent to \n<pre>\n&lt;td>\n<\/pre>');
t.xxtree42.add(377,372,'tdnowrap0','use as : SetVar(temp,tdnowrap0()), Ech1(var(temp)),\nequivalent to \n<pre>\n&lt;td class="nowrap0">\n<\/pre>');
t.xxtree42.add(357,42,'JsTree','This set of function does a tree management\n<br />\n<br />\nThey may seem a little complex but in fact they are generated by a set of functions that takes a table that is self-referenced.\n<br />\n<br />\nSee the use of this tree generation in the How To\'s\n');
t.xxtree42.add(358,357,'JsTreeInit','This function initialises a tree: \n<br />\nThe tipical use of this function is:\n\n<xmp>\n\nTac(\n SetVar(out,Cst(\'<table><tr><td class="RECORD">\')),\n Ech(Var(out)), // the tree is embeded into a table\n\n JsTreeInit(d1,treeCurr,treeInit,Funct(0001),Funct(0002)),\n // d1 is the javascript tree object\n // funct 0001 is the function to activate a branch\n // treeCurr is the reference to the current displayed Id\n // treeInit is the reference to the root id of the tree\n // funct 0002 is the function to manage the fold/unfold + and - buttons\n\n//========= <branches\n Cst(d1),        // name of the JsTree object\n Var(treeInit),\n Var(treeInit),\n Var(treeCurr),\n Var(treeList),\n Cst(0),\n Funct(0003)      // function to display a branch\n//========= branches>\n\n JsTreeOutput(d1,treeList), // outputs the tree\n\n SetVar(out,Cst(\'<\/td><\/tr><\/table>\')),\n Ech(Var(out)),\n\n)\n<\/xmp>');
t.xxtree42.add(359,357,'Branches','There are two functions: \n<br />\n- One for the root\n<br />\n- One for the branches\n<br />\n<br />\nThese functions output a tree branch\n<br />\nA typical use of them is:\n<xmp>\nTac(\n Var(treeDisp),\n Test(\n  Cond(Equal(Var(treeInit))),\n  IfTrue(\n   JsTreeRoot(TreeRef,treeDisp,Name,HasChild)\n  ),\n  IfFalse(\n   JsTreeElement(TreeRef,treeDisp,Name,HasChild,Parent)\n  )\n )\n)\n<\/xmp>');
t.xxtree42.add(360,357,'Boutons','This function is used to add buttons to the current selected branches\n<br />\nA typical use of this function is:\n<xmp>\n JsTreeAdd(TreeRef,treeDisp,BEdit,BAjsBr,BAjApr,BDepla,BSupp),\n // BEdit,BAjsBr,BAjApr,BDepla,BSupp are the buttons to display\n<\/xmp>');
t.xxtree42.add(363,42,'javascripts','Contenu pour le chapitre javascripts');
t.xxtree42.add(364,363,'Update Parent Field','Updates the "field" in the parent window with a NUMERICAL value\n<xmp>\nArg(field),\nArg(Value),\nTac(\n JsUpdateParentFieldNumber(field,Value),\n)\n<\/xmp>\nEquivalent to\n<xmp>\n<'+'script type="text/javascript">\n this.parent.document.getElementById(\\\'\'.$field.\'\\\').value=numberToFormat(\\\'\'.$Value.\'\\\');\n<'+'/script>\n<\/xmp>\n\n\n\nUpdates the "field" in the parent window with a TEXT value\n<xmp>\nArg(field),\nArg(Value),\nTac(\n JsUpdateParentFieldTEXT(field,Value),\n)\n<\/xmp>\nEquivalent to\n<xmp>\n<'+'script type="text/javascript">\nthis.parent.document.getElementById(\\\'\'.$field. \'\\\').value = \n\\\'\'.str_replace( \'\\\'\' , \'\\\\\\\'\' ,  str_replace(  \'\\\\\' , \'\\\\\\\\\',$Valeur ) ) . \'\\\';\n<'+'/script><\/xmp>');
t.xxtree42.add(105,42,'Fonction SQL','Every sql request with a type = SELECT or INSERT or UPDATE or DELETE or DELETE VALUE you create will produce a function. \n<br />\nThis function can be used in the language to do the work \n<br />\n<br />\n<br />\nThe FIRST EXAMPLE section of this documentation give some examples of the use of this button.\n<br />\nWhen you use this button, all the informations about the request are put in tables so the request can be regenerated and can be analysed according to it\'s type and thus, it\'s use.\n<br />\n<br />\nThe request generated with this button are simple. No LEFT/RIGHT JOIN are possible yet.\n<br />\nYou can add some little enhancements by using the "Complementary field" or the "And more" fields.\n<br />\n<br />\nIf you need a very complex request, you can create one, then change its type to MANUAL and then write what you want.\n<br />\nBe careful in that case to respect the good number of parameters in the request specification.\n');
t.xxtree42.add(106,105,'SELECT','<br />\na select request that looks like this:\n<br />\nSelect T0.FIELD1 , T0.FIELD2,,,T0.FIELDn From MyTable T0\n<br />\nProduces a function named R_nnnn_Select() where nnnn is the request number.\n<br />\n<br />\nThe use of this function is\n<XMP>\nR_nnn_Select(\n Do(\n  Take(T0.FIELDi,T0.FIELDj,,,), // value of the fields are pushed in the call stack\n  ffff()                        // function[s] is[are] called\n )                              // values of the fields are poped\n)\n<\/XMP>\nThe field order given in the request can be anything. \n<br />\nThe instructions in the Do block are repeated for each value found in the select.\n<br />\n<br />\n');
t.xxtree42.add(107,105,'DELETE, DELETE VALUE','a DELETE request that looks like this:\n<br />\nDELETE From MyTable where FIELD = %SQLPAR0%\n<br />\nProduces a function named R_nnn_Delete() where nnn is the request number.\n<br />\n<br />\nThe use of this function is\n<XMP>\nTac(\n Var(IndiceToDelete),\n R_nnn_Delete()\n)\n<\/XMP>\nThe Call stack should contain the parameters of the Delete. \n<br />\n<br />\n<br />\nThe DELETE VALUE type is reserved to delete records with the key = the unique ID of the Table.\n<br />\nEvery table must contain a AUTO_INCREMENT field, other tables may refer to that field as a reference.\n<br />\nSo an other function is produced: it is called R_nnn_CrossRef() and checks that no other table refer to the record which is deleted.\n<br />\nYou can use this function independently but it is always called before a delete occurs.\n<br />\n<br />\n<br />\nThe DELETE Type opposed to a DELETE VALUE is also delete BUT with no CrossRef check. <span class=LISTTITLE>Use it with care!<\/span>\n<br />\n');
t.xxtree42.add(108,105,'UPDATE','<br />\nan UPDATE request that looks like this:\n<br />\nUPDATR MyTable set FIELD = %SQLPAR1% where record = %SQLPAR0%\n<br />\nProduces a function named R_nnn_Update() where nnn is the request number.\n<br />\n<br />\nThe use of this function is\n<XMP>\nTac(\n Var(RecordToUpdate),\n Var(FieldToUpdate),\n R_nnn_Update()\n)\n<\/XMP>\nThe Call stack should contain the parameters of the Update. \n<br />\n');
t.xxtree42.add(109,105,'INSERT','An INSERT request that looks like this:\n<br />\nINSERT into MyTable set FIELD = %SQLPAR1% \n<br />\nProduces a function named R_nnnn_Insert() where nnnn is the request number.\n<br />\n<br />\nThe use of this function is\n<XMP>\nTac(\n Var(ValueToInsert),\n R_nnnn_Insert(1) // or R_nnnn_Insert(0) if you do not \n                  // want to want to know the last_insert_id\n SetVar(NewId,Var(R_nnnn_IOne)), // if R_nnnn_Insert(1)\n)\n<\/XMP>\nThe Call stack should contain the parameters of the Insert. \n<br />\n<br />\nIf the Insert is Correct and the parameter is 1, it puts into the variable Stack a variable named R_nnnn_IOne which contains the number of the Auto_Increment field of the new record.\n');
t.xxtree42.add(110,105,'MANUAL','<br />\nan MANUAL request that looks like this:\n<br />\nSELECT count(*) as res from MyTable where FIELD = %SQLPAR0% \n<br />\nProduces a function named R_nnn_Manual() where nnn is the request number.\n<br />\n<br />\nThe use of this function is\n<XMP>\nTac(\n Var(ValueToInsert),\n R_nnn_Manual(ffff())\n)\n<\/XMP>\nThe Call stack should contain the parameters of the request. \n<br />\n<br />\nBe careful to give the good number of parameters in the definition of the Request\n');
t.xxtree42.add(102,105,'ExecuteSQL','<br />\nExecute the SQL string contained in the Last value of the call stack');
t.xxtree42.add(138,42,'Session et variables http','One can update session predefined variables ( SessionVar function)\n<br />\nor\n<br />\ndefine new session variables ( SessionValue functions )');
t.xxtree42.add(121,138,'SetSessionVar','<XMP>\nSetSessionVar(xxx)\n<\/XMP>\nUpdates a session variable with the 2nd last value contained in the call stack.\n<br />\n<br />\nExample: when the user logs in, he is in a group but if you want to give the possibility to a user to change his group dynamically to allow some functions according to the context, use this type of function:\n<XMP>\nTac(\n Var(NewGroupValue), SetSessionVar(xxUserGroup),\n Home()\n)\n<\/XMP>\nNow, the user will have the menus of the group number contained in the variable NewGroupValue\n<br />\n<\/xmp>');
t.xxtree42.add(139,138,'SessionValue','If you need a session variable, you can define one and update or get it\'s value using these functions.\n<br />\nExample: you can put in the loggin function (4003) this code.\n<XMP>\nTac(\n CreateSessionValue(TheNewSessionValue), // define the session value, now, \n                                         // xxxSessionTheNewSessionValue exists in the VarStack\n Var(TheValue),\n SetSessionValue(TheNewSessionValue) // puts TheValue in xxxSessionTheNewSessionValue\n)\n<\/XMP>\nThen, anywhere in the program, you can use the code:\n<XMP>\nTac(\n Cst(),  // put a space in the call stack\n GetSessionValue(TheNewSessionValue), // puts the session value in the call stack ( replaces the space)\n SetVar(TheValue,1) // puts the value in a variable.\n)\n<\/XMP>\n\n\n');
t.xxtree42.add(154,138,'HttpPostVar','Gets a POST variable\n<br />\nExample: This example is the source to get the user name when the user logs in\n<xmp>\nTac(\n SetVar(UserLogginName,HttpPostVar(XXNAME)),\n SetVar(UserLogginPassword,HttpPostVar(XXPASS)),\n)\n<\/xmp>');
t.xxtree42.add(353,138,'HttpGetVar','Gets a GET variable, Example: \n<xmp>\nTac(\n SetVar(MyVar,HttpGetVar(GETNAME)),\n)\n<\/xmp>');
t.xxtree42.add(352,138,'SetHttpPost','Sets a Post variable\n<xmp>\nTac(\n VarG(xxAct),\n Test(\n  Cond(NEqual(GO)),\n  IfTrue(\n   Tac(\n    Cst(0),    SetHttpPost(INPUT2),\n    Cst(0),    SetHttpPost(INPUT3)\n   )\n  )\n )\n)\n<\/xmp>');
t.xxtree42.add(282,138,'Server variables','Gets the $_SERVER variable\n<br />\nExample:<xmp>Tac(\n SetVar(where,Env(\'SERVER_SOFTWARE\')),\n)\n<\/xmp>\nThe values can be for example:\n<br />\nHTTP_REFERER\n<br />\nDOCUMENT_ROOT\n<br />\nPHP_SELF\n<br /> \nSERVER_NAME\n<br />\nHTTP_USER_AGENT\n<br />\n\n');
t.xxtree42.add(287,138,'IsSetSessionVar','Check that a session value exist. Example\n<xmp>\nTac(\n Cst(xxxSessionTargetIsOutside),\n Test(\n  Cond(IsSetSessionVar()),\n  IfTrue(\n   // do something\n  )\n )\n)\n<\/xmp>\n\n ');
t.xxtree42.add(296,138,'IsSetPostVar','Check that a $_POST value exist. \n<br />\nexample:\n<xmp>\nTac(\n Cst(INPUT),\n Test(\n  Cond(IsSetPostVar()),\n  IfTrue(\n   // do something\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(297,138,'IsSetGetVar','Check that a $_GET value exist. \n<br />\nexample:\n<xmp>\nTac(\n Cst(s),\n Test(\n  Cond(IsSetGetVar()),\n  IfTrue(\n   // do something\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(292,42,'Cookies','');
t.xxtree42.add(293,292,'DefineCookie','DefineCookie(Cst(x)|Var(x),Cst(y)|Var(y)),\n<br />\nThis will create a cookie\n');
t.xxtree42.add(294,292,'SetCookie','This will set a cookie:\n<br />\nSetCookie(Cst(x)|Var(x),Cst(y)|Var(y))\n');
t.xxtree42.add(295,292,'Get a cookie','There are 2 ways to gat a cookie:\n<br />\nFirst way: put it in the stack:\n<xmp>\nTac(\n Cookie(Cst(MyCookieName)), // puts the cookie value of MyCookieName in the stack\n Test(\n  Cond(Greater(Var(Total))),\n  IfTrue(\n   SetCookie(Cst(MyCookie),Cst(0))\n  )\n )\n)\n<\/xmp>\nSecond way: put it in a variable\n<xmp>\nTac(\n SetVar(MyCookieValue,Cookie(Cst(MyCookieName))),\n Var(MyCookieValue),\n Test(\n  Cond(Greater(Var(Total))),\n  IfTrue(\n   SetCookie(Cst(MyCookie),Cst(0))\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(140,42,'Date et heure','These functions are set to work with date and time.\n<br />\nNote: I suggest that one creates a table with a calandar, fill it once every five or ten years and work on these values instead of going on computing always the same things.\n\n');
t.xxtree42.add(385,140,'maintenant','Tac(\n SetVar(now,now()) // $now=\'2008-09-14 12:49:35\';\n\n)');
t.xxtree42.add(141,140,'Date','Convert a system format date (yyyy-mm-dd) to a date according to the system setup\n<br />\nExample:\n<xmp>\nTac(\n // these functions use javascript to display the date\n SetVar(MyDate,Cst(2003-10-05)),\n SetVar(MyDate,DateUser(MyDate,0)), // Contains 05/10/03 if we are in france ( DMY format )\n SetVar(MyDate,DateUser(MyDate,1)), // Contains Lu 05/10/03 if we are in france ( DMY format )\n SetVar(MyDate,DateUser(MyDate,2)), // Contains Lundi 05/10/03 if we are in france ( DMY format )\n SetVar(MyDate,DateUser(MyDate,3)), // Contains Lundi 05 Octobre 2003 \n\n // If you want to use php to convert the date, use DateServer instead of DateUser\n)\n<\/xmp>');
t.xxtree42.add(142,140,'a0_AddOneDay:','Computes the day after the one in the call stack. The date must be in a system format (yyyy-mm-dd)\n<br />\nExample:\n<XMP>\nTac(\n Cst(2003-12-31),\n a0_AddOneDay(),\n out(1) // outputs 2004-01-01\n)\n<\/XMP>');
t.xxtree42.add(143,140,'a0_DayOfWeek','Gives the day yhe week of the dates placed in the call stack:\n<br />\n0:sunday\n<br />\n1:monday\n<br />\n2:tuesday\n<br />\n3:wednesday\n<br />\n4:thursday\n<br />\n5:friday\n<br />\n6:saturday\n<br />\nExample:\n<XMP>\nTac(\n Cst(2003-12-31),\n FormatDate(),\n out(1),\n UnformatDate(),\n out(1),\n a0_AddOneDay(), \n out(1),\n a0_DayOfWeek(),\n out(1), // outputs 4\n)\n<\/XMP>');
t.xxtree42.add(82,140,'SetTimeLimit','<br />\nadd n seconds to the execution of an interactive function. A SetTimeLimit(0) (no limit) is always called before a batch function.\n<br />\nSyntax\n<br />\nsetTimeLimit(10) // adds 10 seconds to the php time limit, see the php doc for this.');
t.xxtree42.add(147,42,'Rétro-analyse','Functions for reverse engineering\n<br />\nyou must include the function\n<br />\na0_useRev_0()\n<br />\nbefore using them');
t.xxtree42.add(148,147,'Rev_SourceToArray','Converts a text function to an array\n<xmp>\nTac(\n a0_useRev_0(),\n SetVar(TheSource,\n  Cst(\'Tac(Cst(30),R_1203_Select(Do(Take(T0.Nom),out(1))))\')\n ),\n Rev_SourceToArray(FunctionSource,tf),\n)\n<\/xmp>\n\nNow, tf is an array containing :\n\n<TABLE CELLSPACING=1 CELLPADDING=0>\n  <TR CLASS=LISTHEADER><TD>Ind<\/td>\n    <TD>Function<br />Number<\/td>\n    <TD>Parent<br />Number<\/td>\n    <TD>Order<br />in Parent<\/td>\n    <TD>Function<br />Name<\/td>\n    <TD>Function<br />Type<\/td>\n    <TD>Number of<br />Children<\/td>\n    <TD>Level<\/td>\n    <TD>C1<\/td>\n    <TD>C2<\/td>\n  <\/tr>\n  <tr CLASS=LIST><TD>0<\/td>\n    <TD>0<\/td>    <TD>-1<\/td>    <TD>0<\/td>    <TD>0<\/td>    <TD>INIT<\/td>    <TD>1<\/td>\n    <TD>0<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>1<\/td>\n    <TD>1<\/td>    <TD>0<\/td>    <TD>1<\/td>    <TD>Tac<\/td>    <TD>formula<\/td>\n    <TD>2<\/td>    <TD>1<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>2<\/td>\n    <TD>2<\/td>    <TD>1<\/td>    <TD>1<\/td>    <TD>Cst<\/td>    <TD>formula<\/td>\n    <TD>1<\/td>    <TD>2<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>3<\/td>\n    <TD>3<\/td>    <TD>2<\/td>    <TD>1<\/td>    <TD>30<\/td>    <TD>Value<\/td>\n    <TD>0<\/td>    <TD>3<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>4<\/td>\n    <TD>4<\/td>    <TD>1<\/td>    <TD>2<\/td>    <TD>R_1203_Select<\/td>    <TD>formula<\/td>\n    <TD>1<\/td>    <TD>2<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>5<\/td>\n    <TD>5<\/td>    <TD>4<\/td>    <TD>1<\/td>    <TD>Do<\/td>    <TD>formula<\/td>\n    <TD>2<\/td>    <TD>3<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>6<\/td>\n    <TD>6<\/td>    <TD>5<\/td>    <TD>1<\/td>    <TD>Take<\/td>    <TD>formula<\/td>    <TD>1<\/td>\n    <TD>4<\/td>    <TD><\/td>    <TD><\/td>\n  <\/tr>\n  <TR CLASS=LIST><TD>7<\/td>\n    <TD>7<\/td>    <TD>6<\/td>    <TD>1<\/td>    <TD>T0.Nom<\/td>    <TD>zone<\/td>    <TD>0<\/td>    <TD>5<\/td>    <TD><\/td>    <TD><\/td>  <\/tr>\n  <TR CLASS=LIST><TD>8<\/td>\n    <TD>8<\/td>    <TD>5<\/td>    <TD>2<\/td>    <TD>out<\/td>    <TD>formula<\/td>    <TD>1<\/td>    <TD>4<\/td>    <TD><\/td>    <TD><\/td>  <\/tr>\n  <TR CLASS=LIST><TD>9<\/td>\n    <TD>9<\/td>    <TD>8<\/td>    <TD>1<\/td>    <TD>1<\/td>    <TD>Value<\/td>    <TD>0<\/td>    <TD>5<\/td>    <TD><\/td>    <TD><\/td>  <\/tr>\n<\/table>\n');
t.xxtree42.add(149,147,'Rev_ArrayToSource','Converts an array function to a source function\n<xmp>\nTac(\n a0_useRev_0(),\n\n Rev_ArrayToSource(tf,FunctionSource),\n // now, Function source contains\n // Cst(\'Tac(Cst(30),R_1203_Select(Do(Take(T0.Nom),out(1))))\n\n)\n<\/xmp>\n\n\n');
t.xxtree42.add(150,147,'Rev_ArrayToTable','Load an array in the table yArrayFunct\n<xmp>\nTac(\n\n a0_useRev_0(),\n\n Rev_SourceToArray(FunctionSource,tf),\n Rev_ArrayToTable(tf), // Load an array in the table yArrayFunct\n\n // Do big work on table yArrayFunct\n\n Rev_TableToArray(tf),\n Rev_ArrayToSource(tf,newSource),\n)\n\n<\/xmp>');
t.xxtree42.add(151,147,'Rev_TableToArray','Load the content of table yArrayFunct to an array\n<xmp>\nTac(\n\n a0_useRev_0(),\n\n Rev_SourceToArray(FunctionSource,tf),\n Rev_ArrayToTable(tf), \n\n // Do big work on table yArrayFunct\n\n Rev_TableToArray(tf), // Load the content of table yArrayFunct to an array\n\n Rev_ArrayToSource(tf,newSource),\n)\n\n<\/xmp>');
t.xxtree42.add(152,147,'Rev_TakeOffFunct','Rev_TakeOffFunct() takes off functions in a source\n\n<XMP>\nTac(\n Cst(a0_AskData),\n Cst(a0_list),\n Cst(a0_Screen),\n Cst(3),         // function count to take off\n Rev_TakeOffFunct(FormuleFinale),\n)\n<\/XMP>');
t.xxtree42.add(237,42,'Fonctions prédéfinies','These functions are considered as "system" functions.');
t.xxtree42.add(211,237,'Boutons','Comme on doit souvent créer des boutons, des fonctions prennent ceci en charge.');
t.xxtree42.add(133,211,'Un bouton standard','Two functions, 1001 and 1002, can be used to build a button that appear on the screen. \n<br />\n1001 builds a button without a javascript confirmation \n<br />\n1002 builds a button with a javascript confirmation \n<br />\n<br />\nAn example of the use of these functions is given above: \n<xmp>\nTac(\n SetVar(Button,Funct(xxxx)),  // put the function to call (xxxx) with this button in a variable\n Var(Value01),        // argument 1 for the function xxxx\n Var(Value02),        // argument 2 for the function xxxx\n Var(Value03),        // argument 3 for the function xxxx\n Cst(3),              // argument count\n Cst(.),              // CLASS ( . = normal link )\n Cst(.),              // Image . if none or the name of the image in the /img directory\n Display(2000018),    // TITLE (Tool tip of the button)\n Display(2000019),    // text if no images\n Var(Button),         // Function number to call\n Funct(1001),         // or 1002 for confirm\n SetVar(Button,1),    // Put the html code in a variable to display it\n Ech(Var(Button))      // displays the button\n)\n<\/xmp>\n \n\nThe result is a button that executes the function \n\n<xmp>\nTac( \n Cst(1), // content of Var(Value01)\n Cst(2), // content of Var(Value02)\n Cst(3), // content of Var(Value03)\n Funct(xxxx)\n) \n<\/xmp>\n1, 2 and 3 were contained in Valus01, Valus02, Valus03. ');
t.xxtree42.add(137,211,'Ouvrir une sous fenêtre','Functions, 1003 builds a button that opens an other window. \n<br />\nAn example of the use of this function is given above: \n\n<xmp>\nTac(\n SetVar(BMajTitre,Funct(6783)), // function to call\n Var(DocDict),                  // argument one\n Cst(1),                        // 1 argument \n Cst(OPTION),                   // CLASS of the button\n Cst(u.gif),                    // Image\n Display(2000308),              // TITLE (Tool tip of the button)\n Display(2000308),              // text displayed if no image\n Cst(0),                        // x top\n Cst(0),                        // y left\n Cst(0),                        // x width\n Cst(0),                        // y height\n Var(BMajTitre),                // funct number to call\n Funct(1003),                   \n SetVar(BMajTitre,1),           // BMajTitre contains the code\n), \n<\/xmp>\n\nThe result is a button that opens an other window and executes the function \n<xmp>\nTac(\n Cst(123456), // content of Var(DocDict) \n Funct(6783) \n)\n<\/xmp>\n<br />\nFunction 1004 does the same but the list parameters are saved before\n<br />\nFunction 1016 does the same but the subwindow is hidden\n');
t.xxtree42.add(246,211,'Sur fenêtre principale','This function is used when you want to submit the main window with a function.\n<br />\nAs the main window is submitted, the sub window is closed.\n<xmp>\nTac(\n SetVar(ToCall,Cst(\'Funct(\'),Funct(5001),Cst(\')\')),\n Var(ToCall),\n Funct(1009)\n)\n<\/xmp>');
t.xxtree42.add(134,237,'Lock and unlock a record','To unlock manually a user record, you can use function 1006 with the paramaters:\n<br />\nTableCode\n<br />\nFieldCode');
t.xxtree42.add(247,237,'Modifier le contenu HTML','Set the HTML content of an element with an ID (innerHTML) to a value.\n<br />\nexample:\n<xmp>\nTac(\n SetVar(SpanValue,Cst(\'hello\')),\n SetVar(Sid,Cst(\'MySpanId\')),\n Var(SpanValue),\n Var(Sid),\n Funct(1015) // updates the content of a span\n)\n<\/xmp>');
t.xxtree42.add(90,42,'Divers','<br />\n');
t.xxtree42.add(91,90,'CallFormulaInStack','Executes the function in stack and submit  \n<br />\nExample: to create a new request, one choose a table to get the table code and then the program ac_yTable_CreateSelectRequest is called. To do this, we use\n<xmp>\nSetVar(Formula,\n Cst(\'Tac(Cst(\'),\n Var(TableCode),\n Cst(\'),ac_yTable_CreateSelectRequest())\')\n),\nTac(\n Var(Formula),\n CallFormulaInStack() // The function is submited\n)\n<\/xmp>');
t.xxtree42.add(238,90,'ExecuteFormulaInStack','Executes a function and continues the execution without submitting.\n<br />\nIt is a kind of an "Eval" function.\n<br />\nExample, In the little CRM, in the sub window that contains a list of the other user that have a contact in their list, I want to keep track of the list filter the user enters  ( criterias ). But as it is in "only" a sub window, I don\'t want to keep track of this in a session variable or any other method.\n<br />\nSo in the first list I Build this string :\n<br />\n<xmp>\nSetVar(Hidden,\n Cst(\'SetVar(IdContact,Cst(\'),Var(IdContact),Cst(\')),\'),\n Cst(\'SetVar(Critere,Cst(\\\'\\\'))\'),\n),\n<\/xmp>\nAnd in the line function, I use\n<xmp>\nTac(\n VarG(xxHidd),\n ExecuteFormulaInStack(),\n SetVar(IdContact,VarG(IdContact))\n)\n<\/xmp>');
t.xxtree42.add(92,90,'TestFormula','Return true if the MyPitSelf function looks OK. \n<br />\nExample: when one creates or update a function source, the test which is done is:\n<xmp>\nTac(\n VarG(T0Source), // See if the function is good first\n Test(\n  Cond(TestFormula()),\n  IfFalse(ReturnFalse())\n )\n)\n<\/xmp>\n\n');
t.xxtree42.add(99,90,'PrintFormulaInStack','<br />\nPrint the formula in a table view');
t.xxtree42.add(100,90,'CryptValue','<br />\nmd5 of the last value in call stack');
t.xxtree42.add(113,90,'a0_Batch','Executes the function in a batch mode\n<br />\nSyntax:\n<xmp>\nTac(\n a0_Batch(Funct(xxxx)[,Log(0|1)]), // or\n a0_Batch(a0_yyyy([a0_zzzz])[,Log(0|1)])\n)\n<\/xmp>\nwhere xxxx is the function number to execute\n<br />\nyyyy is a core function\n<br />\nzzzz is a core librairy ( type a0_useXml ) containing yyyy\n<br />\n<br />\nLog(0) doesn\'t outputs a log file that can be seen with the tool/see batch result\n<br />\n<br />\nIf the debug mode is on, Log is always set to 1 by a0_Batch\n<br />\nDefault is Log(1)');
t.xxtree42.add(157,90,'IncludePhp','Example\n<br />\n IncludePhp(xxx)\n<br />\nxxx is a variable name\n');
t.xxtree42.add(244,90,'OutputBuffering','If wou want to save the html output in a variable\n<br />\nExample:\n<xmp>\nOutputBuffering(                // start buffering \n Tac(                           // do the job\n  Var(RFileContent),            \n  PhpEvalNoReturn(),            // I want to save the result of this action\n  OutputBufferingGetContents(), // I call this, the VarStack now contains the output\n  SetVar(WFileContent,1)        // and I save it in a variable\n  a0_File(\n   FileName(CSSFile),\n   FilePtr(fpw),\n   Action(w),\n   Do(\n    a0_WriteVarStackInFile(WFileContent,fpw)\n   )\n  )\n )\n)\n<\/xmp>');
t.xxtree42.add(257,90,'PhpTest','Test if a php source is correct.\nExample:\n<xmp>\nTac(\n Var(FileContent),\n PhpTest(),\n Test(\n  Cond(EEqual(FALSE)), // test this php function\n  IfTrue(\n   ShowMsg(2000252),\n   ReturnFalse()\n  )\n )\n)\n<\/xmp>\n');
t.xxtree42.add(382,42,'Exemples de sources','');
t.xxtree42.add(383,382,'HTML to tidy Html','<xmp>\n // replace in ySource html by tidy html\n a0_useHtml_0()\n Cst(0),\n R_1892_Select(\n  Do(\n   Take(T0.Code,T0.Type,T0.Name,T0.Source),\n   SetVar(T0Code,4),\n   SetVar(T0Type,3),\n   SetVar(T0Name,2),\n   SetVar(T0Source,1),\n   Tac(\n    Var(T0Code),\n    Var(T0Type),\n    Test(\n     Cond(Equal(DOC)),\n     IfTrue(\n      Tac(\n       SetVar(IsHt,Cst(0))\n       SetVar(ToSearch,Cst(\'.htm\')), Var(ToSearch), Var(T0Name),\n       Test(Cond(StringIsInString()),IfTrue(SetVar(IsHt,Cst(1))))\n\n       SetVar(ToSearch,Cst(\'.html\')), Var(ToSearch), Var(T0Name),\n       Test(Cond(StringIsInString()),IfTrue(SetVar(IsHt,Cst(1))))\n\n       Var(IsHt),\n       Test(\n        Cond(Equal(2)), // change this to 1 to do the job\n        IfTrue(\n         Tac(\n          SetVar(T0Source,html_ToXhtml(T0Source)),\n          SetVar(T0Source,html_getBodyContent(T0Source)),\n          Var(T0Code),\n          Var(T0Source),\n          R_1698_Update()\n         )\n        ),\n       ),\n       Var(T0Code),\n       Test(\n        Cond(Equal(12)), // do it for one source\n        IfTrue(\n         Tac(\n          Var(T0Code),\n          Var(T0Source),\n//          R_1698_Update()\n          Ech1(Var(T0Source)),out()\n         )\n        ),\n       ),\n\n      )\n     ),\n    ),\n   )\n  )\n ), // 1892 \n<\/xmp>');
t.xxtree42.SetLoaded();
