Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does VFP have problem with nbsp?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01539945
Message ID:
01539953
Views:
32
>>Hi,
>>
>>If you run this code below you will see that the column fld1_fld2 of the resulting query does not have the entry in FLD2 for the first 3 records. The difference is that the first 3 records have 6 charecter entry and they are padded with more of & nbsp. Anybody see why?
>>
>>
>>CREATE CURSOR test (fld1 c(15), fld2 c(35))
>>INSERT INTO test (fld1, fld2) VALUES ("123456","Descripton of 123456")
>>INSERT INTO test (fld1, fld2) VALUES ("334343","Descripton of 334343")
>>INSERT INTO test (fld1, fld2) VALUES ("337743","Descripton of 337743")
>>INSERT INTO test (fld1, fld2) VALUES ("3343430000000","Descripton of 3343430000000")
>>
>>select *, ALLTRIM(FLD1) + REPLICATE( ' ', 15-LEN(ALLTRIM(FLD1)) ) +  ' ' + ALLTRIM(FLD2) AS FLD1_FLD2 from test 
>>
>
>Because the field initial length is too short:
>
>select *, ;
>  padr(ALLTRIM(FLD1) + REPLICATE( ' ', 15-LEN(ALLTRIM(FLD1)) ) +  ' ' + ALLTRIM(FLD2),200) ;
>        AS FLD1_FLD2 ;
>from test
>
Just saw your line about "the field initial length is too short" and it now makes sense. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform