Re: transfering datas from a program to another

Tech-Archive recommends: Fix windows errors by optimizing your registry



"Youri Ligotmi" <yl@xxxxxxxxxxxxxxx> wrote in message
news:45ad4105$0$304$426a74cc@xxxxxxxxxxxxxxx
hi there

first of all I apologize for my bad english.
I've a problem, a vbs program (prog1.vbs) calls another one (prog2.vbs)
and passes datas to it.
The datas are strings, a problem occurs when there is a space in a data,
it's seen as 2 datas because the data separator is the space.
What is the solution for this problem?

example of my programs:

******** prog1.vbs *********
Set Shell = Wscript.CreateObject("Wscript.Shell")
data = InputBox("Data?","Data")
shell.run "prog2.vbs"&" "&data
****************************

******** prog2.vbs *********
wscript.echo args(0)
****************************

If I enter "AB" then "AB" is displayed
If I enter "A B" then only "A" is displayed

Please note that in the real life many datas are transfered from the 1st
program to the 2nd and in each of them it could have many space.

Thanks for your help

phil

Enclose each argument (parameter) that has spaces in
quotation marks; (i.e. Chr(34)).

For example,

shell.run "prog2.vbs" & " " & Chr(34) & data & Chr(34)

Presuming that the argument does not contain any quotes...


.



Relevant Pages

  • Re: transfering datas from a program to another
    ... first of all I apologize for my bad english. ... a vbs program calls another one ... The datas are strings, a problem occurs when there is a space in a data, ...
    (microsoft.public.scripting.vbscript)
  • transfering datas from a program to another
    ... first of all I apologize for my bad english. ... a vbs program calls another one and passes datas to it. ... The datas are strings, a problem occurs when there is a space in a data, it's seen as 2 datas because the data separator is the space. ...
    (microsoft.public.scripting.vbscript)