Link to home
Start Free TrialLog in
Avatar of LJ083198
LJ083198

asked on

converting null to " "

I have a user defined type with fixed length strings.  When I print out to a file, if the string is empty, it is putting null characters in the file.  I need it to just have empty spaces.  I have tried reading each character using IsNull and check and replacing with " ", but it didn't work.  How do I get it to print out the file with empty spaces and not nulls?
ASKER CERTIFIED SOLUTION
Avatar of mark2150
mark2150

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BergJC
BergJC

Can you show your code? How are you writing it out to the file currently?
Avatar of LJ083198

ASKER

Mark2150's solution would certainly work, but I have over 80 fields in each record of which half might be empty.  I was looking for a way to  check the whole thing for null and replace with a space, without doing each field individually.  
In response to BergJC I aam using a print# command.  When the file is opened it looks fine, and it has all it's spaces.  The problem comes when the file is used in the next application, the null are picked up as spaces.  They are essentially eliminated from the file.
Do you have control over the next application? This might be something that could be solved in the receiving application. Assuming, of course, that you do have control over the receiving app, which may not be the case.
unfortuantely no, I don't have control over the next application.