Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange unprinting character in string returned from Registry

Status
Not open for further replies.
Dec 8, 2001
15
0
0
GB
Thanks to those who answered the call for help on 'ADO routine adding record rather than updating if record exists'

Now for my next problem.

I am returning a string value from the registry and despite doing a TRIM of the string there appears to be some non-printing character attaching itself to the end of the string. This upsets my data comparison routine as the string is in effect 1 character longer than you would expect.

I have cured the problem by using Left(strComputerName, (LEN(strComputerName -1 )) but does anyone know what the character is and if there is a better way of not returning it in the first place?

Thanks in advance

Corkyballs
 
You can find out what it is by running this code in the immediate window while your program is at a breakpoint:
[tt]
print asc(right$(strComputerName, 1))
[/tt]
I suspect it's a null (ascii 0), in which case your existing code will handle it.

Chip H.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top