Fill Character field with spaces

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
Rich_Brown_(Guest)
Posts: 1
Joined: Tue Oct 10, 2017 12:44 pm

Fill Character field with spaces

Post by Rich_Brown_(Guest) » Wed Sep 11, 2002 5:36 pm

I have created a report for EXPORT which has the employees name at the end of the record. The system we will be transmitting the data to wants a 19 character field at the end of the record, with spaces to fill the field. The total record length is 132.____I have a field defined as EMPNAME and the calculation of:__RTRIM(P_LNAME) + ", " + P_FNAME____When I run the query it constantly removes all trailing spaces making the record a variable length record. In properties for the field I have set the length to 19 characters.____I am using R&R 6.5, but have XBASE 8.1 available if needed.____Thank you for your help.

ariel_(Guest)
Posts: 2
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Fill Character field with spcs

Post by ariel_(Guest) » Wed Sep 11, 2002 7:11 pm

i have gotten around r&r^s propensity to trim fields despite my best efforts to tell it not to by doing something along these lines:____fieldname space(##-len(fieldname))____where you replace ## with the number of spaces that you wish the field to have.

freitas
Posts: 68
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Fill field with spaces

Post by freitas » Thu Sep 12, 2002 5:03 pm

[updated:LAST EDITED ON Sep-12-02 AT 05:05 PM (EST)]I created a calcuated __rtrim(first_name)+" "+ rtrim(last_name) = name____I then wrote another calulated field__iif(len(name) < 19, name+space(19-len(name)),substr(name,1,19))____It gave me a length of 19 every time. Note that at the end, if the name field is greater then 19, I only show the first 19 positions.__

Post Reply