Página 1 de 1

Quirk in viewing arrays with backslashes

Publicado: Dom Ene 02, 2011 8:37 pm
por Guest
Hi,
If you trace through the code of the SQL Helper, specifically this snippet:
nNumberOfInstances := Len( aInstances )
If nNumberOfInstances > 0
For nThInstance = 1 To nNumberOfInstances
sInstance := aInstances[ nThInstance ]
If Empty( sInstance )
aInstances[ nThInstance ] := NIL
Elseif sInstance == "MSSQLSERVER" // Default instance
sInstance := sComputerName
aInstances[ nThInstance ] := sInstance
Else
// Otherwise, just append the instance name to the
machine name
sInstance := sComputerName + "" + sInstance
// ************************************************************
// *****After the following line, the sInstance variable contains e.g.
MYPCFIRSTINSTANCE:
aInstances[ nThInstance ] := sInstance
// *****, but aInstances[ nThInstance ] contains MYPCFIRSTINSTANCE,
with a double backslash.
// ************************************************************
Endif
, notice that if you equate an array element to a string with a single
backslash, the array element contains a double backslash.
The extra backslash is obviously used behind the scenes as an escape
character, because of the C language foundation for xHarbour. But it
shouldn't be displayed that way, on the surface.
Regards,