enclosing variable in quotes

Kenneth Brody kenbrody at spamcop.net
Sat Aug 4 15:40:03 PDT 2018


On 2/13/2018 6:29 PM, scooter6--- via Filepro-list wrote:
> If I'm wanting to pass my variable with double quotes included, why does
> processing not like this?
> 
> aa=somedata
> 
> ab="\"aa\""
> 
> This simply returns literally  "aa"

Yes, I know this is old, but I don't see anyone explaining the "why" part of 
the question.

Think about what the string -- "\"aa\"" -- means:

     "  -- open quote
     \" -- a quote within the string
     aa -- the letters 'a' and 'a'
     \" -- another quote within the string
     "  -- close quote

The characters "aa" are within the quotes.

> How do I get it to show   "somedata"?
> 
> This doesn't work either    ab="\"{aa\""   or   ab="\"<aa\""

You need to close the quotes before "aa" and re-open them:

     ab = "\"" { aa { "\""

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the Filepro-list mailing list