Jump to content
Britton Ward

Strings and quotes

Recommended Posts

Hi.

 

I've written a small program to do some geometry modifications and have set it up as a local software connector.

 

The executable call is as follows:

 

"C:/Work/Programming Projects/FFDMorph/FFDMorph/Debug/FFDMorph.exe" "C:\Program Files (x86)\FRIENDSHIP-SYSTEMS\CAESES-FFW\my projects\SRFTest\SRFTest\manual_results\baseline\input\export.srf" "C:\Program Files (x86)\FRIENDSHIP-SYSTEMS\CAESES-FFW\my projects\SRFTest\SRFTest\manual_results\baseline\input\FFDMorph.in"
 
the arguments to be passed to the program consist of the two file names with paths.
 
Because my program is fortran it requires the two path strings to be surrounded by quotes as above. I can't seem to figure out how to combine the two filename strings within the framework into a single string that contains the quotes to close the first path and open the second with a space between.
 
FSExport|f1:file.getFileName() + " " + FFDInputFile:file.getFileName()       -> what syntax is needed to get the quotes to appear in here?
 
"C:\Program Files (x86)\FRIENDSHIP-SYSTEMS\CAESES-FFW\my projects\SRFTest\SRFTest\manual_results\baseline\input\export.srf C:\Program Files (x86)\FRIENDSHIP-SYSTEMS\CAESES-FFW\my projects\SRFTest\SRFTest\manual_results\baseline\input\FFDMorph.in"
 
or is there a way to have more than one argument for a software connector?
 
Thanks

Share this post


Link to post
Share on other sites

Hi,

 

what you need to do is "escape" those quotes using a backslash:

"\"" + FSExport|f1:file.getFileName() + "\" \"" + FFDInputFile:file.getFileName() +"\""

This is not only necessary for fortran code, but everytime you need to pass an argument to a program that contains spaces (e.g. pathes with spaces).

Share this post


Link to post
Share on other sites

By the way, I have noticed in a preview that the spaces where replaced by some character, I don't recall what it was, but they where actually executed correctly.

Claus

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...