[InstallScript Language Reference]goto

The goto keyword is used to branch directly to the statement immediately following a specified label. In the following code fragment, the goto statement causes execution to continue with the AskText statement.

 

Name: 
AskText("Company name:", "", szSrc); 
if (szSrc = "") then 
    MessageBox("Please enter the company name.", SEVERE); 
    goto Name; 
endif;

 

A goto statement in the main program must specify a label that has been declared in the main program. A goto statement in a function must specify a label that has been declared in that function.

 

InstallScript supports a special form of the if statement that can be used only with goto statements:

 

   if condition goto labelname;

 

This special structure is has the following features:

  • The condition must be followed by a goto statement.

  • The keyword then is not used.

  • The keyword endif is not used.

 

In the following example, the user will be prompted to enter a company name as long as szSrc is a null string (“”).

 

     Name: 
      AskText("Company name:", "", szSrc); 
      if (szSrc = "") goto Name; 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值