[Ecostruxure Control Expert] [Tuto] Conversion en majuscules
Posté : 02 mars 2023, 21:53
slts,
Via la COM je reçois une chaîne de caractères en minuscules, exemple pour la convertir en majuscules
---------
(*Test*)
STR_MINUSCULES:='papa maman'
TAB_INT:= STRING_TO_ASCII(STR_MINUSCULES);
for XX:=0 to LEN_INT(STR_MINUSCULES)/2 do
WX:=TAB_INT[XX];
if WX.13 and WX.14 then TAB_INT[XX].13:=false;end_if;
if WX.5 and WX.6 then TAB_INT[XX].5:=false;end_if;
end_for;
STR_MAJUSCULES:= ASCII_TO_STRING(TAB_INT) ;
(*result
STR_MAJUSCULES = 'PAPA MAMAN'
*)
Via la COM je reçois une chaîne de caractères en minuscules, exemple pour la convertir en majuscules
---------
(*Test*)
STR_MINUSCULES:='papa maman'
TAB_INT:= STRING_TO_ASCII(STR_MINUSCULES);
for XX:=0 to LEN_INT(STR_MINUSCULES)/2 do
WX:=TAB_INT[XX];
if WX.13 and WX.14 then TAB_INT[XX].13:=false;end_if;
if WX.5 and WX.6 then TAB_INT[XX].5:=false;end_if;
end_for;
STR_MAJUSCULES:= ASCII_TO_STRING(TAB_INT) ;
(*result
STR_MAJUSCULES = 'PAPA MAMAN'
*)