RIGHT
Àðãóìåíòû:
IN MSG ëþáàÿ íåïóñòàÿ ñòðîêà
NbC INT íå ìîæåò áûòü áîëüøå, ÷åì äëèíà ñòðîêè IN
Q MSG ïðàâàÿ ÷àñòü ñòðîêè IN (åå äëèíà = NbC)
ïóñòàÿ ñòðîêà åñëè NbC < 0
âñÿ ñòðîêà IN åñëè NbC > äëèíà IN
Îïèñàíèå:
Áåðåò ïðàâóþ ÷àñòü ñòðîêè. Êîëè÷åñòâî ñèìâîëîâ çàäàíî.
(*FBD ïðèìåð áëîêîâ “LEFT” è “RIGHT”*)
(* ST Ýêâèâàëåíò: *)
complete_string := RIGHT ('12345678', 4) + LEFT ('12345678', 4);
(* ïîëíàÿ ñòðîêà - ýòî '56781234'
çíà÷åíèå âûõîäÿùåå èç RIGHT - ýòî '5678'
çíà÷åíèå âûõîäÿùåå èç LEFT - ýòî '1234'
*)
(* IL Ýêâèâàëåíò: Ñíà÷àëà âûçûâàåòñÿ LEFT *)
LD '12345678'
LEFT 4
ST sub_string (* ïðîìåæóòî÷íûé ðåçóëüòàò *)
LD '12345678'
RIGHT 4
ADD sub_string
ST complete_string