从标签内跳转到另一个标签 [英] Jump to another label from within a label

查看:64
本文介绍了从标签内跳转到另一个标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在NSIS中,如何从另一个标签中跳转到一个标签?

注意:我不确定我在说的内容实际上是否称为标签,因此如果我写错了请纠正我.

Note: I am not sure if what I am talking about is actually called a label so correct me if I am wrong.

在下面的代码中,我想跳转到标签"InstallFiles",请参见#SEE HERE"行:

In the following code I want to jump to the label 'InstallFiles', see the line '# SEE HERE':

# the following code is from within a macro
# Check the directory exists
IfFileExists $installDirectory InstallFiles CreateDirThenInstall

CreateDirThenInstall:   # this is a label...I think? :P
  file $installDirectory
  # SEE HERE: HOW DO I call the label 'InstallFiles'?

InstallFiles:
  DetailPrint "SetOverwrite on."
  SetOverwrite try
  SetOutPath "${dir}"
  file "Attributes_to_trees_panel.4do"
  file "ATTRIBUTES_TO_TREES_PANEL.hlp"

推荐答案

您无需做任何操作,只需从 CreateDirThenInstall下面的行转到 InstallFiles 标签:只需让执行到达以下行即可.

You have nothing to do for going to the InstallFiles label from the line below CreateDirThenInstall : just let the execution reach the following line.

您可能会误解了标签实际上并没有声明子程序,它们仅放置可以从任何流控制指令(在 current 函数或部分中)访问的符号",例如StrCmp IntCmp Goto .如果标签上方有语句,并且在其之前没有跳转或 Return ,则执行将继续到标签后的下一条语句.

You might have misunderstood that labels do not actually declare sub programs, they only put "signs" that can be reached from any flow control instruction (in the current Function or Section) like StrCmp, IntCmp and Gotos. If there are statements above a label and there is no jump or Return just before it, the execution continues to the next statement after the label.

这篇关于从标签内跳转到另一个标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆