H HARRY Active Member Licensed User Longtime User Dec 18, 2007 #1 Hi, Quite some time I had no opportunity to program; therefore I have forgotten some simple things. Two questions: 1) How to include quote (") symbols in a string variable? 2) Is Shell variable name a valid statement? Variable should include (" "," ")? Thanks for some help Harry
Hi, Quite some time I had no opportunity to program; therefore I have forgotten some simple things. Two questions: 1) How to include quote (") symbols in a string variable? 2) Is Shell variable name a valid statement? Variable should include (" "," ")? Thanks for some help Harry
agraham Expert Licensed User Longtime User Dec 18, 2007 #2 HARRY said: 1) How to include quote (") symbols in a string variable? Click to expand... "first bit " & chr(34) & "second bit". It's in Help - Main Help - Keywords - String - Chr Is Shell variable name a valid statement? Variable should include (" "," ")? Click to expand... Sorry, don't understand!
HARRY said: 1) How to include quote (") symbols in a string variable? Click to expand... "first bit " & chr(34) & "second bit". It's in Help - Main Help - Keywords - String - Chr Is Shell variable name a valid statement? Variable should include (" "," ")? Click to expand... Sorry, don't understand!
agraham Expert Licensed User Longtime User Dec 18, 2007 #3 HARRY said: 2) Is Shell variable name a valid statement? Variable should include (" "," ")? Click to expand... Is this what you are asking about? Code: app = "someapp" arglist =Chr(34) & "this is arg0" & Chr(34) & " arg1" & " arg2 arg3" Shell(app, arglist) Note that the quoted string is a single argument and that spaces separate the non-quoted arguments otherwise they appear as one argument
HARRY said: 2) Is Shell variable name a valid statement? Variable should include (" "," ")? Click to expand... Is this what you are asking about? Code: app = "someapp" arglist =Chr(34) & "this is arg0" & Chr(34) & " arg1" & " arg2 arg3" Shell(app, arglist) Note that the quoted string is a single argument and that spaces separate the non-quoted arguments otherwise they appear as one argument
H HARRY Active Member Licensed User Longtime User Dec 18, 2007 #4 Hello Agraham, Thanks for your prompt reply. The second question in fact was whether the parameter following the Shell statement can be a variable or must be a string itself. I think that a variable is allowed. Testing some more I got the following problem: Two lines of coding: DelStr="(" & Chr(34) & "C:\Program Files\MortScript\MortScript.exe" & Chr(34) & "," & Chr(34) & "C:\Program Files\MortScript\Delete.mscr, DelName=" & DestPath & "Data.zip" & Chr(34) & ")" Shell Delstr The contents of DelStr now is : ("C:\Program Files\MortScript\MortScript.exe","C:\Program Files\MortScript\Delete.mscr, DelName=C:\MIOMAP\UI_S\Data.zip") This results into the message: Invalid characters in path. Is this caused by the space between Program and Files and how to solve this ? Harry
Hello Agraham, Thanks for your prompt reply. The second question in fact was whether the parameter following the Shell statement can be a variable or must be a string itself. I think that a variable is allowed. Testing some more I got the following problem: Two lines of coding: DelStr="(" & Chr(34) & "C:\Program Files\MortScript\MortScript.exe" & Chr(34) & "," & Chr(34) & "C:\Program Files\MortScript\Delete.mscr, DelName=" & DestPath & "Data.zip" & Chr(34) & ")" Shell Delstr The contents of DelStr now is : ("C:\Program Files\MortScript\MortScript.exe","C:\Program Files\MortScript\Delete.mscr, DelName=C:\MIOMAP\UI_S\Data.zip") This results into the message: Invalid characters in path. Is this caused by the space between Program and Files and how to solve this ? Harry
Erel B4X founder Staff member Licensed User Longtime User Dec 18, 2007 #5 You will need to use two variables. One for the first argument and one for the second: Code: V1 = Chr(34) & "C:\Program Files\MortScript\MortScript.exe" & Chr(34) V2 = Chr(34) & "C:\Program Files\MortScript\Delete.mscr, DelName=" & DestPath & "Data.zip" & Chr(34) Shell(V1,V2)
You will need to use two variables. One for the first argument and one for the second: Code: V1 = Chr(34) & "C:\Program Files\MortScript\MortScript.exe" & Chr(34) V2 = Chr(34) & "C:\Program Files\MortScript\Delete.mscr, DelName=" & DestPath & "Data.zip" & Chr(34) Shell(V1,V2)