问题
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 Goto
s. 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