- Statements that can return a value
- Other statements used to exit from a loop or from a procedure
- Types returned
- Multiple return values
返回 is used to exit from the current process (or procedure) and to return a status report. This status report can correspond to: The 返回 statement can be used in: 18版本和更高版本 18新版本
// Call to a procedure that returns NOTHING if a problem occurs // Different process according to the return value Control_Value是字符串型 Control_Value=MyProcess(Control_Name) 如果Control_Value="Nothing",那么 信息("No value was calculated") 否则 信息("Value of the control: "+Control_Value) 结束
// -- Procedure MyProcess 过程MyProcess(Control) 如果Control..类型=类型.文本型输入框,那么 发送回Control..值 否则 发送回"Nothing" 结束
语法
Procedure 隐藏详细信息
过程 <Procedure Name> ([<Parameter>]) IF <Condition> THEN RESULT <Value(s) to Return> ELSE RESULT <Value(s) to Return> END
Notes: - The following operations are performed if <Condition> is fulfilled:
- Return a status report to the calling process. The type and value of <Value to return> depend on the value expected by the process calling the procedure.
- Exit from the statement block.
- Exit from the current process (or procedure).
- You have the ability to return several values. See Multiple return values for more details.
Closing code of the window or page 隐藏详细信息
返回 <Value to Return>
Notes: - In this case, <Value to Return> must correspond to the expected value during the call to the window or to the page.
- You have the ability to return several values. See Multiple return values for more details.
Code for closing the window, the page or the report 隐藏详细信息
返回 <Value to Return>
Notes: - In this case, <Value to Return> must correspond to the expected value during the call to the window, to the page or to the report.
- You have the ability to return several values. See Multiple return values for more details.
Closing code of the project 隐藏详细信息
返回 <Value to Return>
Note: In this case, <Value to Return> must be an integer. This value can be retrieved by any application. For a WinDev application, the value returned by another application can be retrieved by 启动应用程序.
注意
Statements that can return a value Several statements can return a value in a procedure: - IF statement
PROCEDURE <Procedure Name> ([<Parameter>]) IF <Condition> THEN RESULT <Value to Return> ELSE RESULT <Value to Return> END
- FOR statement
PROCEDURE <Procedure Name> ([<Parameter>]) FOR <Control Variable> = <Initial Value> TO <Final Value> [STEP <x>] IF <Condition> THEN RESULT <Value to Return> END
- FOR EACH statement
PROCEDURE <Procedure Name> ([<Parameter>]) FOR EACH <File> ON <Key Item> ... IF <Condition> THEN RESULT <Value to Return> END
- LOOP statement
PROCEDURE <Procedure Name> ([<Parameter>]) LOOP ... IF <Condition> THEN RESULT <Value to Return> ... END
- WHILE statement
PROCEDURE <Procedure Name> ([<Parameter>]) WHILE <Condition 1> ... IF <Condition> THEN RESULT <Value to Return> ... END
Note: These statements can also return several values. See Multiple return values for more details.
Other statements used to exit from a loop or from a procedure Several statements are available: - 返回 statement: Exit from the loop and exit from the current process (or procedure).
- 跳出 statement/"跳出:" label: Exit from the loop and run the rest of the current process (or procedure).
关闭 is used to exit from the loop (or procedure) and to close the current window. Caution: 返回 statement and 返回 cannot be used in the same process.
Types returned 15版本和更高版本From version 15, the following types can be used: - structure
- dynamic structure
- class
- advanced type
- array
- associative array
- queue
- stack
- list
15新版本From version 15, the following types can be used: - structure
- dynamic structure
- class
- advanced type
- array
- associative array
- queue
- stack
- list
From version 15, the following types can be used:- structure
- dynamic structure
- class
- advanced type
- array
- associative array
- queue
- stack
- list
|
|
| | |
|