Jump to another label from within a label

别来无恙 提交于 2019-12-25 08:27:50

问题


In NSIS, how do I jump to a label from within another label?

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

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"

回答1:


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

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.



来源:https://stackoverflow.com/questions/10426008/jump-to-another-label-from-within-a-label

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!