WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Variables and Parameters

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Using GoTo based on Variable Substitution

Keywords:    goto variable substitution percent  3033 label not found

Question:

I am new to WinBatch and am trying to GoTo a subroutine based on a passed parameter, e.g, if options are one or two:
Script = param1
GoTo Script
:one
Beep
Exit
:two
Beep
Beep
The parameter is passed correctly, but I then get error 3033 label not found.

Answer:

For that trick you need substitution:
	goto script
looks for a label of script. What you want is:
	goto %script%
where the contents of the script variable replaces %script%.

On the topic of substitution note that "%script%" is the same as plain script.


Article ID:   W13923
Filename:   Using Goto Based on Variable Substitution.txt
File Created: 1999:04:15:16:57:18
Last Updated: 1999:04:15:16:57:18