Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
103 user(s) are online (95 user(s) are browsing Forums)

Members: 1
Guests: 102

smarkusg, more...

Support us!

Headlines

 
  Register To Post  

Arexx Escape Codes
Quite a regular
Quite a regular


See User information
Hello,

The following command sent to an Arexx Port is accepted:

ADD DATESTRING '"Wednesday 30 November 2011"' ENDDATESTRING '"Wednesday 30 November 2011"' TIME '"11:00"' ENDTIME '"12:00"' TITLE '"lunch break"' NOTE '""' REPEAT '"1"'

But if wanted to change 'lunch break' into for example 'mum's birthday' or even add "hello" into the notes.. how do I do this?

In other words how do I correctly escape single quotation and regular quotation marks?

I tried backslashing single quotation and regular quotation marks, but wasn't successful.

Go to top
Re: Arexx Escape Codes
Home away from home
Home away from home


See User information
/**/

say " test""ing"

say ' mums''birthday'



Go to top
Re: Arexx Escape Codes
Just can't stay away
Just can't stay away


See User information
i have been struggling with this more than once in the past

Go to top
Re: Arexx Escape Codes
Amigans Defender
Amigans Defender


See User information
Quote:

broadblues wrote:
/**/

say " test""ing"

say ' mums''birthday'




also:

say 'test"ing'

say "mums'birthday"

will work if there isn't an insane level of quotes already.

Go to top
Re: Arexx Escape Codes
Home away from home
Home away from home


See User information
@ Chris
True, but I think looking at the quoted command that was the situation. Too many quotes...

Actually I found that by experimentation, couldn't remeber it either.


Go to top
Re: Arexx Escape Codes
Quite a regular
Quite a regular


See User information
Well I have success escaping single quotation marks by simply escaping it with another.

No luck with double quotation marks - so instead double quotation marks are treated as single quotation marks and escaped that way which is satisfactory.

Go to top
Re: Arexx Escape Codes
Home away from home
Home away from home


See User information
It should work with double quotes too, my test above did.


BTW your quoted code above can get you inot difficulties if any variables accidentally cooincide with the terms


ADD DATESTRING '"Wednesday 30 November 2011"' ENDDATESTRING '"Wednesday 30 November 2011"' TIME '"11:00"' ENDTIME '"12:00"' TITLE '"lunch break"' NOTE '""' REPEAT '"1"'


would be better as

'ADD DATESTRING "Wednesday 30 November 2011" ENDDATESTRING "Wednesday 30 November 2011" TIME "11:00" ENDTIME "12:00" TITLE "lunch break" NOTE "" REPEAT "1"'


(NB the whole string is srrounded by sigle quotes not just the arguments)

in your above 'ADD' 'DATESTRING' etc etc will get replaced by any variable in your script with the same name. Either you have to be very careful about variable name choice or simply quoting the command saves the risk.

Go to top
Re: Arexx Escape Codes
Just can't stay away
Just can't stay away


See User information
You can also use d2c() to accomplish this.

You can also define a single quote or double quote

SQuote="'"
DQuote='"'

..if you wanted to, but escaping it with another quote of the same type works fine for me too.

SAY 'Mum''s' = Mum's
SAY "Mum's" = Mum's
SAY 'Mum"s' = Mum"s
SAY "Mum""s" = Mum"s

(Didn't test it, but that should be correct)

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project