Page 1 of 1

String problem

Posted: Tue Aug 14, 2007 10:00 am
by Marc Vanzegbroeck
Hi,

Does enyone know why I get twice the same result.

Code: Select all

FUNCTION test()
   local cValue := Space( 256 )
   GetEnvironmentVariable( "USERPROFILE", cValue, Len( cValue ) )
   cValue=alltrim(cValue)
   MsgInfo(cValue)
   cValue+='\Test'
   MsgInfo(cValue)
RETURN
Thanks,
Marc

Posted: Tue Aug 14, 2007 10:54 am
by Antonio Linares
Marc,

Do it this way:

Code: Select all

FUNCTION test() 
   local cValue := GetEnv( "USERPROFILE" )
   cValue+='\Test' 
   MsgInfo(cValue) 
RETURN 

Posted: Tue Aug 14, 2007 12:12 pm
by Marc Vanzegbroeck
Thanks Antonio, it's working fine now.

Regards,
Marc