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.

Passing Parameters when Parameters Being Sent include Spaces

Keywords:     spaces in parameters

Question:

I have run into a situation with .wbt files where I pass information back and forth through call parameters. This works if your parameters are without spaces, example: call ("process.wbt", "hello new 1") Process.wbt will read the parameters as param 1, param2, and param3.

I run into a problem when a parameter being sent includes spaces, example:

send_var= "hello world"
call ("process.wbt", "%send_var% new 1")
when process.wbt reads the parameters, it assigns param1 as hello param2 as world and param 3 as new...the 1 is dropped.

Do you know a way around this?

Answer:

If your parameters might contain spaces or tabs, you must put double quotes around them, like... (Done by using single and double quotes here)
send_var= ' "hello world" '
call ('process.wbt', '%send_var% new 1')

Article ID:   W13916
Filename:   Passing Parameters with Spaces in Names.txt
File Created: 1999:04:15:16:57:16
Last Updated: 1999:04:15:16:57:16