MasteringVFP/2/4/1
出自VFP Wiki
MasteringVFP/2/4/1
的原始碼
跳轉到:
導航
,
搜尋
根據以下的原因,您並無權限去做編輯這個頁面:
你所請求執行的操作被禁止。
你可以檢視並複製本頁面的原始碼。
* [http://cobasrolda.com/sitdomvio.html domrelcacn] http://trvimonta.com/c4tlilaacelr.html[domrelcacn] [[http://trvimonta.com/c4tlilaacelr.html][domrelcacn]] * http://monc4te.com/relroget.html domrelcacn * [[http://violodelge.com/boctrelte.html domrelcacn]] * [[http://rotrocboct.com/eldomcnacda.html|domrelcacn]] * [[http://pastrmondo.com/laoloe.html | domrelcacn]] * [http://trocorc4ttr.com/oloeracelt.html|domrelcacn] * [domrelcacn|http://vilaoloc4.com/oupastr.html] * ((http://taorra.com/gettroc.html domrelcacn)) * [domrelcacn](http://boctrocbonod.com/chireldarla.html "domrelcacn") "domrelcacn":http://sitelta.com/monrodard.html For-loop,æè®å¤¾å¨ For è next ä¹éçç¨å¼éè¤å·è¡ n 次. èä¾ä¾èªª: <pre> For i=1 to 10 ? "Hello world" next </pre> å°±æå°åºå次 "Hello world" å¦å¤ä¸åè®åå½¢çæç¨,æ¯å¦é樣: <pre> For i=1 to 10 step 2 ? "Hello world" next </pre> é樣就åªæå°åºäºæ¬¡ "Hello world" å. å¦ææ³å¨ For-loop 裡é¢ä½å¤æ·,符åæ¢ä»¶å°±è·³åº,é£éº¼ä½ å¯ä»¥é©æçå ä¸ if, continue è exit. å¦ä¸ä¾: <pre> For i=1 to 10 if i=5 exit else ? "Hello world" continue endif next <pre> ç¶ i=5 çæå,å°±æè·³åºè¿´å,å¦æå°æ¼ 5 ç話,åå°åº "Hello world",並繼çºéåè¿´å. ---- = FOR ... ENDFOR å½ä»¤ = == ç¨é == :ææå®ç次æ¸éè¤å·è¡ä¸çµå½ä»¤ã == èªæ³ == :FOR ''Var'' = ''nInitialValue'' TO ''nFinalValue'' [STEP ''nIncrement''] ::''Commands'' ::[EXIT] ::[LOOP] :ENDFOR | NEXT == åæ¸ == === ''Var'' === *æå®ä½çºè¨æ¸å¨çè¨æ¶é«è®æ¸æé£åå ç´ ãå¨ FOR ... ENDFOR å·è¡ä¹åï¼æ¤è¨æ¶é«è®æ¸æé£åå ç´ ä¸ä¸å®åå¨ã === ''nInitialValue'' TO ''nFinalValue'' === *''nInitialValue'' æ¯è¨æ¸å¨çåå§å¼ï¼è ''nFinalValue'' æ¯è¨æ¸å¨ççµæ¢å¼ã === STEP ''nIncrement'' === *''nIncrement'' æ¯è¨æ¸å¨éå¢æéæ¸çæ¸éãå¦æ ''nIncrement'' çºè² ï¼åè¨æ¸å¨éæ¸ï¼å¦æçç¥ STEP åå¥ï¼è¨æ¸å¨æ¯æ¬¡çå¢éçº 1ã === ''Commands'' === *æå®è¦å·è¡ç Visual !FoxPro å½ä»¤ï¼''Commands'' å¯ä»¥å å«ä»»ææ¸ç®çå½ä»¤ã === EXIT === *å¨ FOR ... ENDFOR 循ç°ä¸ï¼å°æ§å¶æ¬è¿ é移è½çµ¦ç·æ¥å¨ ENDFOR çä¸ä¸åå½ä»¤ãæ¨å¯ä»¥å° EXIT å¯ä»¥æ¾å¨ FOR è ENDFOR ä¹éçä»»ä½ä½ç½®ã === LOOP === *å°æ§å¶æ¬ç´æ¥å³çµ¦ FOR åå¥ï¼ä¸åå·è¡ LOOP è ENDFOR ä¹éçæè¿°ãè¨æ¸å¨æ£å¸¸éå¢æéæ¸ï¼å°±åå·è¡å° ENDFOR ä¸æ¨£ãLOOP å¯ä»¥æ¾å¨ FOR è ENDFOR ä¹éçä»»ä½ä½ç½®ã == é註 == *å¯ä»¥ç¨è¨æ¶é«è®æ¸æé£åå ç´ ä½çºè¨æ¸å¨ï¼æå® FOR ... ENDFOR 循ç°ä¸ Visual !FoxPro å½ä»¤çå·è¡æ¬¡æ¸ã *å¨éå° ENDFOR æ NEXT ä¹åï¼å§çµå·è¡ FOR å¾é¢ç Visual !FoxPro å½ä»¤ãå·è¡éç¨ä¸ï¼æ¯å¾ªç°ä¸æ¬¡ï¼è¨æ¸å¨ ''Var'' é½æéå¢ï¼å¢éçº ''nIncrement''ï¼å¦æçç¥ STEP åå¥ï¼åè¨æ¸å¨æ¯æ¬¡çå¢éçº 1ï¼ï¼ç¶å¾æè¨æ¸å¨çå¼è ''nFinalValue'' ä½æ¯è¼ãå¦æè¨æ¸å¨çå¼å°æ¼æçæ¼ ''nFinalValue''ï¼å°å次å·è¡ FOR åå¥å¾çå½ä»¤ï¼å¦æè¨æ¸å¨çå¼å¤§æ¼ ''nFinalValue''ï¼åéåº FOR ... ENDFOR 循ç°ï¼ç¨åºç¹¼çºå·è¡ ENDFOR æ NEXT ä¹å¾çä¸ä¸åå½ä»¤ã **'''注æ''' ::''nInitialValue''ã''nFinalValue'' å ''nIncrement'' åªè½æ¯å次è®å ¥çå¼ãå¨å¾ªç°éç¨ä¸æ´æ¹è¨æ¸å¨ ''Var'' çå¼å°å½±é¿å¾ªç°çå·è¡æ¬¡æ¸ã *å¦æ ''nIncrement'' çºè² ï¼ä¸åå§å¼ ''nInitialValue'' 大æ¼çµæ¢å¼ ''nFinalValue''ï¼åæ¯ç¶éä¸æ¬¡å¾ªç°ï¼è¨æ¸å¨é½å°éæ¸ã == ç¯ä¾ == å¨ç¯ä¾ 1 ä¸ï¼é¡¯ç¤ºæ¸å 1 å° 10ã ç¯ä¾ 2 使ç¨è¨æ¶é«è®æ¸ä½çºåå§å¼ãçµæ¢å¼å STEP å¼ï¼é¡¯ç¤º customer è³æè¡¨æ ¼ä¸å¾ 2 èå° 10 èè¨éä¸ææè¨éèçºå¶æ¸çè¨éã ç¯ä¾ 1 <pre> CLEAR FOR gnCount = 1 TO 10 ã? gnCount ENDFOR ç¯ä¾ 2 SET TALK OFF CLOSE DATABASES OPEN DATABASE (HOME(2) + 'Data\testdata') USE customerããã && éå Customer è³æè¡¨æ ¼ STORE 2 TO gnIãã && åå§å¼ STORE 10 TO gnJãã&& çµæ¢å¼ STORE 2 TO Kããã && Step å¼ FOR gnCount = gnI TO gnJ STEP K ãGOTO gnCountãã && 移åè¨éææ¨ ãDISPLAY companyã&& é¡¯ç¤ºå ¬å¸å稱 ENDFOR </pre>
返回到
MasteringVFP/2/4/1
。
檢視
頁面
討論
原始碼
歷史
個人工具
登入/建立新帳號 選單
導航
首頁
社群入口
現時事件
近期變動
隨機頁面
使用說明
搜尋
工具箱
鏈入頁面
相關頁面修訂記錄
所有特殊頁面