PC SOFT

WINDEV的在线文档

  • CONTINUE statement: example not to do:
  • Example for using the "CONTINUE:" label
  • "CONTINUE:" statement: Case of nested loops
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

继续 is used to directly go back to the beginning of the next iteration without ending the code of the current iteration.

继续 can be used in the following types of loops:

18版本和更高版本
WinDevWindows Store apps This feature is available in Windows Store apps mode.
18新版本
WinDevWindows Store apps This feature is available in Windows Store apps mode.
WinDevWindows Store apps This feature is available in Windows Store apps mode.
The 继续 keyword can correspond to:
  • the 继续 statement:
    继续 is used to directly go back to the beginning of the next iteration without ending the code of the current iteration.
    继续 can be used in the following types of loops:
  • 19版本和更高版本
    the CONTINUE: label:
    The "CONTINUE:" label is used to declare a common code in a loop. This code will be run:
    • for each iteration of the loop.
    • if the "CONTINUE" statement is found in the loop. In this case, the code found between the "CONTINUE" statement and the "CONTINUE:" label will not be run.
    19新版本
    the CONTINUE: label:
    The "CONTINUE:" label is used to declare a common code in a loop. This code will be run:
    • for each iteration of the loop.
    • if the "CONTINUE" statement is found in the loop. In this case, the code found between the "CONTINUE" statement and the "CONTINUE:" label will not be run.
    the CONTINUE: label:
    The "CONTINUE:" label is used to declare a common code in a loop. This code will be run:
    • for each iteration of the loop.
    • if the "CONTINUE" statement is found in the loop. In this case, the code found between the "CONTINUE" statement and the "CONTINUE:" label will not be run.

语法

CONTINUE statement used in a FOR statement 隐藏详细信息

 对于 <Control Variable> = <Initial Value> TO <Final Value> [STEP <x>]
...    
IF <Condition> THEN CONTINUE
...
END
Note: If <Condition> is True:
  • The code found after the 继续 statement is not run.
  • The loop is run from the beginning of the 对于 statement statement.
  • The <Control Variable> is incremented.

CONTINUE statement used in a FOR EACH statement 隐藏详细信息

 对于 EACH <File> ON <Key Item>
   ...
   IF <Condition> THEN CONTINUE
   ...
END

Note: If <Condition> is True:
  • The code found after the 继续 statement is not run.
  • The loop is run from the beginning of the 对于 每个/对于 ALL statement statement.
  • The move to the next record is automatically performed.

CONTINUE statement used in a WHILE statement 隐藏详细信息

 只要 <Condition 1>
   ...    
IF <Condition2> THEN CONTINUE
   ...
END
Note: If <Condition 2> is True:
  • The code found after the 继续 statement is not run.
  • The loop is run from the beginning of the 只要 statement statement.

注意

CONTINUE statement: example not to do:

In this code, using the 继续 keyword triggers the non-execution of H读下一个:

H读第一个AccountNoAccount
只要不H超出()
如果Account.NoAccount"XXX",那么继续
跟踪Account.NoAccount
H读下一个AccountNoAccount
结束

19版本和更高版本

Example for using the "CONTINUE:" label

In this example, the following elements are added:
  • the amount of each invoice in the TotInv variable.
  • the amount if it is a credit in the TotCredit variable .

TotInv货币型
TotCredit货币型

H读第一个InvoiceInvNum
只要不H超出()
如果Invoice.Invoice_Type不等于"Credit",那么继续
// Goes to the CONTINUE: label directly
// Adds the credits here
TotCredit+=Invoice.Amount

继续:
// Adds all the amounts
TotInv+=Invoice.Amount
H读下一个InvoiceInvNum
结束
19新版本

Example for using the "CONTINUE:" label

In this example, the following elements are added:
  • the amount of each invoice in the TotInv variable.
  • the amount if it is a credit in the TotCredit variable .

TotInv货币型
TotCredit货币型

H读第一个InvoiceInvNum
只要不H超出()
如果Invoice.Invoice_Type不等于"Credit",那么继续
// Goes to the CONTINUE: label directly
// Adds the credits here
TotCredit+=Invoice.Amount

继续:
// Adds all the amounts
TotInv+=Invoice.Amount
H读下一个InvoiceInvNum
结束

Example for using the "CONTINUE:" label

In this example, the following elements are added:
  • the amount of each invoice in the TotInv variable.
  • the amount if it is a credit in the TotCredit variable .

TotInv货币型
TotCredit货币型

H读第一个InvoiceInvNum
只要不H超出()
如果Invoice.Invoice_Type不等于"Credit",那么继续
// Goes to the CONTINUE: label directly
// Adds the credits here
TotCredit+=Invoice.Amount

继续:
// Adds all the amounts
TotInv+=Invoice.Amount
H读下一个InvoiceInvNum
结束

19版本和更高版本

"CONTINUE:" statement: Case of nested loops

When you have several nested loops, you must sometimes continue on the next iteration of one of the previous level without ending the current loop.

To do so, the 继续 statement accepts a parameter specifying the number of levels to move up. The syntax is as follows:

CONTINUE[<Number of Levels>]

where <Number of Levels> is an integer between 1 and N, N representing the number of nested levels for the loop.

For example:

xyz整数型

对于x1直到15// Loop 1
对于y1直到25// Loop 2
对于z1直到50// Loop 3
如果小于Myconditionchecked大于,那么
继续(1
// Stops the browse of loop 3
// and goes to the following iteration of loop 2
结束
结束
结束
结束
19新版本

"CONTINUE:" statement: Case of nested loops

When you have several nested loops, you must sometimes continue on the next iteration of one of the previous level without ending the current loop.

To do so, the 继续 statement accepts a parameter specifying the number of levels to move up. The syntax is as follows:

CONTINUE[<Number of Levels>]

where <Number of Levels> is an integer between 1 and N, N representing the number of nested levels for the loop.

For example:

xyz整数型

对于x1直到15// Loop 1
对于y1直到25// Loop 2
对于z1直到50// Loop 3
如果小于Myconditionchecked大于,那么
继续(1
// Stops the browse of loop 3
// and goes to the following iteration of loop 2
结束
结束
结束
结束

"CONTINUE:" statement: Case of nested loops

When you have several nested loops, you must sometimes continue on the next iteration of one of the previous level without ending the current loop.

To do so, the 继续 statement accepts a parameter specifying the number of levels to move up. The syntax is as follows:

CONTINUE[<Number of Levels>]

where <Number of Levels> is an integer between 1 and N, N representing the number of nested levels for the loop.

For example:

xyz整数型

对于x1直到15// Loop 1
对于y1直到25// Loop 2
对于z1直到50// Loop 3
如果小于Myconditionchecked大于,那么
继续(1
// Stops the browse of loop 3
// and goes to the following iteration of loop 2
结束
结束
结束
结束