Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
stolve
Newbie


Joined: 14 Oct 2014
Posts: 1

PostPosted: Tue Oct 14, 2014 12:49 am   

#launch issues
 
I'm trying to use #launch to access an external application I wrote. I can use #LAUNCH to access this application easily, but I run into issues when I want to send arguments to my application.

Here's an example of what I'm trying to accomplish.

I want to send the text I'm getting as one argument to the program, I would accomplish this in a cmd window by surrounding it in double quotes. It then thinks of it as one string. In order to use the launch command, however, I need to put double quotes around my text. Now I have nested double quotes and I can't, for the life of me, figure out how to escape the double quotes in order to nest them.

I'm using zScript because I can't figure out how to use the #LAUNCH command in the other options. Here is what I have:

Code:
#launch %concat( "C:\Program Files (x86)\myprogram\myprogram.exe /p ", %1, " /m ", %2, " /d 10" )


The %1 and %2 are both text that I'm getting from the trigger, the /p and /m are argument markers for my program and mark where the text is going to be.

Can anyone tell me how to use escape characters in zScript so that I can nest double quotes?!?!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Oct 14, 2014 5:01 am   
 
%concat("stuff you want to see before the double quote",~","stuff you want to see after the first double quote",~","and so on")
_________________
EDIT: I didn't like my old signature
Reply with quote
rozdwojeniejazni
Wanderer


Joined: 13 Aug 2011
Posts: 74

PostPosted: Tue Oct 14, 2014 4:15 pm   
 
Or write it twice: "" to get one double quote inside a string. Like this
Code:
%concat( "C:\Program Files (x86)\myprogram\myprogram.exe /p """, %1, """ /m """, %2, """ /d 10" )
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net