Page 1 of 1 1
Topic Options
#206100 - 2012-11-01 01:01 PM Writing "@" character in text
BEHE Offline
Just in Town

Registered: 2012-11-01
Posts: 2
Loc: Denmark
Hi folks,

I'm trying to write a registry value that is set to display a users mail address.
So far, I've used;
 Code:
Writevalue( "HKEY_CURRENT_USER\Mail" , "Mail" , "%username%@domain.com" , "REG_SZ" )


Problem is.. The output in the registry shows up as "username<unkown:domain.com"
To do a little testing i added;
 Code:
If @ReturnCode = 0
   
   ? "@"

Endif


..And sure enough, the resulting "return text" is simply:
0
<unknown:

Is there a way to get around this, and somehow input the "@" character? I was thinking along the lines of somehow using the ASCII code instead, but I couldn't find any solutions by trawling through the command ref..

Top
#206101 - 2012-11-01 02:08 PM Re: Writing "@" character in text [Re: BEHE]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
@ is a used for macros in kix. To avoid this problem, double up on the @, ie "@@domain", or use $RC=setoption("NoMacrosInStrings","on").
Top
#206104 - 2012-11-01 02:46 PM Re: Writing "@" character in text [Re: Allen]
BEHE Offline
Just in Town

Registered: 2012-11-01
Posts: 2
Loc: Denmark
Fantastic - Thanks!

Tested, working, and implemented \:\)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1441 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.054 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org