Normal Topic "Quotation Marks" (Read 7531 times)
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
"Quotation Marks"
Mar 5th, 2018 at 1:10am
Print Post Print Post  
Hello, I was wondering if it was possible at all to use "Quotation Marks" within a String, or any other kind of variable for that matter.

Here is my problem. I want to use CreateAProcess to run a simple copy or move file operation. I've figured out exactly what I want that Command Prompt (cmd) line to say. However, here's my issue. When using a command like say MOVE or COPY, and you're specifying your directories or filenames Windows does not like spaces, and it will often if not always return you a syntax error. The solution? You have to surround your filenames or directories (folders) with quotation marks. Here's an example:
Code
Select All
C:\>move C:\Users\User\Pictures\aactionsprinkler\site-icon-retro.png C:\Users\User\"Google Drive"\"AAction Photos"\
 


See how I had to put quotation marks around those last two folders?

My problem is that, in Sesame Designer Program Editor, or sBasic in general I cannot put quotation marks within quotation marks.

All I can come up with for now or figure out, is that I might need to use FileWrite to somehow create a .txt file with the exact text I want then use FileRead or ASyncShell or something to plug it back into Sesame.

If anybody's got any ideas or suggestions I'm all ears.
  
Back to top
 
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: "Quotation Marks"
Reply #1 - Mar 5th, 2018 at 1:28am
Print Post Print Post  
If there isn't a workaround, I would suggest that in future version you could enclose quotation marks within apostrophes like with php:

Code (PHP)
Select All
$mystring = "hello,";
$mystring = 'hello "John",';
 

  
Back to top
 
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: "Quotation Marks"
Reply #2 - Mar 5th, 2018 at 2:06am
Print Post Print Post  
Found my answer. Thank goodness for ASCII.

Code
Select All
var vDir as String
var vFolder as String

vFolder = Record_ID

vQuote = @CHR(34)
vDir = "C:\Users\User\""Google Drive""\ + @CHR(34)  + vFolder + @CHR(34)
 



I also found that you could use "" like that in some instances and that would give you quotes as well, but not in the instance of having to add to a variable.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: "Quotation Marks"
Reply #3 - Mar 5th, 2018 at 2:21pm
Print Post Print Post  
actiontech wrote on Mar 5th, 2018 at 2:06am:
I also found that you could use "" like that in some instances and that would give you quotes as well, but not in the instance of having to add to a variable.


You can use "" in every instance. The code would simply be
Code
Select All
vDir = "C:\Users\User\""Google Drive""\""" + vFolder + """" 



Two double quote marks to say that you want a literal double quote and then another double quote to close or open the string.

or even simplier:
Code
Select All
vDir = """C:\Users\User\Google Drive\" + vFolder + """" 


as you can just quote the entire path..

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: "Quotation Marks"
Reply #4 - Mar 6th, 2018 at 12:32am
Print Post Print Post  
Cool, thanks, I'll try that.
  
Back to top
 
IP Logged