PC SOFT

WINDEV的在线文档

  • Operating mode
  • Special case
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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本地访问

The END: label is used to define a code that will be systematically run at the end of the process execution. This code will be run even if the exit from the process is performed by 返回 statement or by 返回 statement (except for an exception process triggered by ExceptionThrow).

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.
例子
过程CompareContentFile1File2

// Opens the files
nFile1整数型文件打开File1文件打开.
nFile2整数型文件打开File2文件打开.

// Returns -3 if an opening error occurred
如果nFile1=-1或者nFile2=-1,那么发送回-3

// Reads the first line of each file
sLine1字符串型文件读一行nFile1
sLine2字符串型文件读一行nFile2
nLine整数型1

循环
// If the two lines are empty, the end of the two files has been reached
// Returns 0
如果sLine1定界符最优并且sLine2定界符,那么发送回0

// If end of file 1, the file 1 is shorter
// returns -1
如果sLine1定界符,那么发送回-1

// If end of file 2, the file 2 is shorter
// returns -2
如果sLine2定界符,那么发送回-2

// If the lines are different, returns the number of the different line
如果sLine1不等于sLine2,那么发送回nLine

// Goes to the next line
sLine1文件读一行nFile1
sLine2文件读一行nFile2
nLine++
结束

结束:
// Closes the files
文件关闭nFile1
文件关闭nFile2

语法
 // Main code
...
IF ...THEN
  ...
  RESULT 0
END
...
IF ...THEN
  ...
  RESULT 1
END

RESULT 2

// Statements run in all cases
// at the end of the process execution
END:
...

注意

Operating mode

The value to return is stored and the code following the "END:" label is run. The value is returned at the end of execution of the code following the "END:" statement

Note: The END: label is also run after the automatic management of errors if this one is enabled (by "CASE ERROR:" and "CASE EXCEPTION:").

Special case

The code following the "END:" label is not run after a call to 重新输入 or to 关闭. 重新输入 can be replaced by the call to 屏幕第一个所在 followed by RETURN or RESULT.