Char values automatically left justified building an array

Char values automatically left justified building an array

Postby Rick Lipkin » Wed Dec 21, 2016 5:28 pm

To All

I have a Sql Primary key value that is char(18) .. When I generate a random key I sometimes get a value like this with leading and trailing spaces .. and that is fine.
Code: Select all  Expand view

aEmp := {}

cName := "Rick Lipkin"
cEid     := "     12345678    "    

AAdd( aEmp, {cName,cEid} )
 


When I go to load the above character value cEid into an array the char value is truncated and loads as a left justified value .. similar to :

Code: Select all  Expand view

       A                 B
|Rick Lipkin    |12345678      |
 


Is there a way to initialize the array to accept the 'exact' value I am loading to the array element ?

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Char values automatically left justified building an array

Postby nageswaragunupudi » Thu Dec 22, 2016 3:51 am

When I go to load the above character value cEid into an array the char value is truncated and loads as a left justified value

No. The value is not trimmed. Please check again.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests