ST缁撴瀯缂栫▼-寰幆.zip_ST寰幆璇彞for,while,repeat缂栫▼瀹炰緥 - 閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛

閰峰痉缃

HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鎼滅储闄勪欢  

ST缁撴瀯缂栫▼-寰幆.zip

 

ST寰幆璇彞for,while,repeat缂栫▼瀹炰緥:
ST缂栫▼-寰幆璇彞FOR/WHILE/REPEAT璇彞鐢

1. FOR璇彞
鈶犲叧閿瓧FOR
鈶OR寰幆鍙互缂栧啓澶勭悊閲嶅閫昏緫銆
鈶㈣娉曡〃杈
FOR i:=璧峰鍊(鏁存暟) TO 缁撴潫鍊(鏁存暟) BY {姝ラ暱( 鏁存暟)} DO
{璇彞;}
END_FOR
鈶OR璇彞鎵ц閫昏緫鍥撅細
鎻愮ず锛
{}鍙渷鐣,鐪佺暐榛樿姝ラ暱涓姣忛儴閫掑鎴栭掑噺1锛
鈶OR璇彞搴旂敤浜庡惊鐜鏁版湁闄愮殑寰幆锛
鈶OR寰幆娆℃暟杩囧ぇ浼氬鍔犵▼搴忔壂鎻忔椂闂
鈶璇彞;}鍙湁涓鏉¤鍙ユ椂锛寋}鍙渷鐣

FOR浣跨敤瀹炰緥



2. WHILE璇彞
鈶犲叧閿瓧WHILE
鈶HILE 寰幆锛屽彲浠ョ紪鍐欏鐞嗛噸澶嶉昏緫銆
鈶㈣娉曡〃杈
WHILE 鐪熷亣閫昏緫琛ㄨ揪寮廌O
璇彞;
END_WHILE;
鈶HILE璇彞鎵ц閫昏緫鍥撅細
鎻愮ず锛
WHILE璇彞搴旂敤浜庡惊鐜鏁颁笉纭畾鐨勫惊鐜紱
鈶″垽鏂潯浠跺彲鐢ㄤ换鎰忕湡鍋囬昏緫琛ㄨ揪寮
鈶㈢湡鍋囬昏緫琛ㄨ揪寮忎竴鐩翠负鐪燂紝浼氳繘鍏ユ寰幆锛
  缂栫▼鏃跺簲閬垮厤姝诲惊鐜
WHILE浣跨敤瀹炰緥

3. REPEAT璇彞
鍏抽敭瀛桼EPEAT锛孯EPEAT 寰幆鏉′欢鏄湪寰幆鎸囦护鎵ц鍚庢墠妫鏌ョ殑锛屽嵆涓嶇寰幆鏉′欢鍙栧煎浣曪紝寰幆鑷冲皯鎵ц涓娆★紱

鈶犲叧閿瓧REPEAT
鈶¢氳繃REPEAT寰幆锛屽彲浠ョ紪鍐欏鐞嗛噸澶嶉昏緫銆
鈶㈣娉曡〃杈
REPEAT
璇彞;
UNTIL 鐪熷亣閫昏緫琛ㄨ揪寮
END_REPEAT;
鈶EPEAT璇彞鎵ц閫昏緫鍥撅細

鎻愮ず锛
鈶燫EPEAT璇彞搴旂敤浜庡惊鐜鏁颁笉纭畾鐨勫惊鐜紱
鈶″惊鐜嚦灏戜細鎵ц涓娆
鈶㈠垽鏂潯浠跺彲鐢ㄤ换鎰忕湡鍋囬昏緫琛ㄨ揪寮
鈶g湡鍋囬昏緫琛ㄨ揪寮忎竴鐩翠负鐪燂紝浼氳繘鍏ユ寰幆锛
  缂栫▼鏃跺簲閬垮厤姝诲惊鐜

REPEAT浣跨敤瀹炰緥
[size=0.83em]repeat.png (22.25 KB, 涓嬭浇娆℃暟: 2018)
涓嬭浇闄勪欢
[color=rgb(204, 204, 204) !important]2020-2-24 14:16 涓婁紶






[hide]
                               
                                [/hide]
椤堕儴qrcode搴曢儴
鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

QQ|灏忛粦灞|鎵嬫満鐗|Archiver|閰峰痉璁哄潧 ( 鑻廔CP澶16065247鍙-1 )|缃戠珯鍦板浘

GMT+8, 2024-11-23 16:45 , Processed in 0.096696 second(s), 21 queries .

閰峰痉缃

© 2001-2013 Hicodesys. 鎶鏈敮鎸 by 閰峰痉缃

杩斿洖椤堕儴