PC SOFT

WINDEV的在线文档

  • Label Code
  • Limits of labels
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系: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 跳到 statement is used to run a code identified by a given label.

Important: The label and the 跳到 statement must necessarily be defined in the same process.

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.
例子
Res文件打开FileName文件打开.
如果Res=-1,那么跳到ERROPEN
Res文件写Res"Process OK"
如果Res=-1,那么跳到ERRWRITE
...
发送回
ERROPEN:
信息"The file "+FileName+" cannot be opened. Check its existence."
发送回
ERRWRITE:
信息"Unable to write into "+FileName
发送回

语法
 跳到 <Label Name>
...
<Label Name>:
<Label Code>

<GOTO>:
Runs the code identified by the label.
<Label Name>:
Name of the label whose code must be run. This name must be followed by ":". This label and the 跳到 statement must be found in the same process.
<Label Code>:
Code that must be run when 跳到 calls the label.

注意

Label Code

Once the code of the label has been run, the program runs the code lines that directly follow the label.

Limits of labels

  • Several labels with the same name cannot be used in the same process (or procedure).
  • A warning is displayed during the compilation of the project if a label is used by no 跳到 statement.