StrXXX
Fonctions sur les chaînes de caractères (String) 

Fonctions de traitement de chaînes :
SLG(str) / StrLen(str)
Retourne la taille du string
SLF(str,size) / StrLeft(str,size)
Retourne la partie de gauche du string
SRI(str,size) / StrRight(str,size)
Retourne la partie de droite du string
SSB(str, beginIndex[, endIndex]) / StrSubstr(str, beginIndex[, endIndex])
Retourne une partie du string (Substring) entre le beginIndex et e endIndex
SMD(str, beginIndex[, size]) / StrMid(str, beginIndex[, size])
Retourne une partie du string depuis le beginIndex, sur une longueur définie
Exemple :
SLF(Hello world,5);
=> Hello
SRI(Hello world,5);
=> world
SSB(Hello world,3,8);
Strsubstr(Hello world,3,8);
=> lo wo
SSB(hamburger,4,8);
=> "urge"
SMD(Hello world,3,5);
=> lo wo
Fonctions de comparaison de chaînes :
StrEquals / SEQ
StrGrt / SGT
StrGrtEquals / SGE
StrLess / SLS
StrLessEquals / SLE
Syntaxe :
StrXXX(Val1,Val2)
Compare alphanumériquement les valeurs données en paramètres, et retourne la réponse boolean.
Utile dans les fonctions de conditions comme IF()
Exemple
Multi(DP(*OK Multi 1),Setglobal(gCpt,1),Printvars(),DP(*OK Multi 2));
If($(gCpt),DP[*OK gCpt=1 a],DP[!KO gCpt!=1 a]);
If($(gCpt),DP(*OK gCpt=1 b),DP(!KO gCpt!=1 b));
DG(gCpt);
If($(gCpt),DP[!KO gCpt=1 c],DP[*OK gCpt!=1 c]);
If($(gCpt),DP(!KO gCpt=1 d),DP(*OK gCpt!=1 d));
And(1,1,1);And(1,0,1);
Equals(1,0);Equals(1,1);
Equals(hello,Hello);Equals(hello,hello);
If(And(1,1,1),DP(*OK And1=1),DP(!KO And1!=1));
If(And(1,0,1),DP(!KO And2=1),DP(*OK And2!=1));
If(NEQ(hello,Hello),DP(!KO Hello1),DP(*OK Hello1));
If(NEQ(hello,hello),DP(*OK Hello2),DP(!KO Hello2));
If(NEQ(1,0),DP(!KO Eq10),DP(*OK Eq10));
If(NEQ(1,1),DP(*OK Eq11),DP(!KO Eq11));
If(SGT(1,0),DP(*OK 1 sgt 0),DP(!KO 1 sgt 0));
If(SGT(1,1),DP(!KO 1 sgt 1),DP(*OK 1 sgt 1));
If(SGE(1,1),DP(*OK 1 sge 1),DP(!KO 1 sge 1));
If(SLS(1,0),DP(!KO 1 sls 0),DP(*OK 1 sls 0));
If(SLS(0,1),DP(*OK 1 sls 0),DP(!KO 1 sls 0));
If(SLS(1,1),DP(!KO 1 sls 1),DP(*OK 1 sls 1));
If(SLE(1,1),DP(*OK 1 sle 1),DP(!KO 1 sle 1));
If(SEQ(hello,Hello),DP(!KO SEQ Hello1),DP(*OK SEQ Hello1));
If(SEQ(hello,hello),DP(*OK SEQ Hello2),DP(!KO SEQ Hello2));
If(SGT(BBB,AAAA),DP(*OK BBB sgt AAAA),DP(!KO BBB sgt AAAA));
If(SGT(BBB,BBB),DP(!KO BBB sgt BBB),DP(*OK BBB sgt BBB));
If(SGE(BBB,BBB),DP(*OK BBB sge BBB),DP(!KO BBB sge BBB));
If(SLS(BBB,AAAA),DP(!KO BBB sls AAAA),DP(*OK BBB sls AAAA));
If(SLS(AAAA,BBB),DP(*OK AAAA sls BBB),DP(!KO AAAA sls BBB));
If(SLS(BBB,BBB),DP(!KO BBB sls BBB),DP(*OK BBB sls BBB));
If(SLE(BBB,BBB),DP(*OK BBB sle BBB),DP(!KO BBB sle BBB));
Créé avec HelpNDoc Personal Edition: Générateur de documentation et EPub gratuit