ISaGRAF. Version 3.4

         

LEFT


Àðãóìåíòû:

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



Ñîäåðæàíèå ðàçäåëà