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: W13916Filename: Passing Parameters with Spaces in Names.txt