RE: Creating fixed field length records

2007-10-26 Thread Len Morgan
While I'm at it, if I DO have to create a string of first, how do I create a string of spaces long? Thanks again, len morgan ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage you

RE: Creating fixed field length records

2007-10-26 Thread Stephen Barncard
this should work (not tested) put multiChar(space,396) into tPaddedLine function multiChar pChar,pRecordLength repeat with n = 1 to pRecordLength put pChar after tOut end repeat return tOut end multiChar While I'm at it, if I DO have to create a string of first, how do I create a strin

Re: Creating fixed field length records

2007-10-26 Thread Alex Tweedly
Len Morgan wrote: While I'm at it, if I DO have to create a string of first, how do I create a string of spaces long? put format("%396s", " ") into myRecord or put format("%" & numSpaces & "s", " ") into myRecord -- Alex Tweedly mailto:[EMAIL PROTECTED] www.tweedly.net

Re: Creating fixed field length records

2007-10-26 Thread Jim Ault
Expanding the previous answers to padding an existing string -using Alex Tweedly's format answer get "the subject is padding" --or get space --or get empty put 63 into limit put char 1 to limit of (it & format("%" & limit & "s", " ")) into myRecord put myRecord & "(

RE: Creating fixed field length records

2007-10-27 Thread Rob Cozens
Hi Len, While I'm at it, if I DO have to create a string of first, how do I create a string of spaces long? Another approach: put empty into recordBuffer set the itemDelimiter to space put empty into item of recordBuffer Rob Cozens CCW Serendipity Software Company

RE: Creating fixed field length records

2007-10-27 Thread Stephen Barncard
Now THAT is clever! Hi Len, While I'm at it, if I DO have to create a string of first, how do I create a string of spaces long? Another approach: put empty into recordBuffer set the itemDelimiter to space put empty into item of recordBuffer Rob Cozens CCW --

Re: Creating fixed field length records

2007-10-27 Thread Phil Davis
It really IS clever! I'll be using that one. However, it needs a small tweak to yield the correct length string (see below). Phil Davis Stephen Barncard wrote: Now THAT is clever! Hi Len, While I'm at it, if I DO have to create a string of first, how do I create a string of spaces long

Re: Creating fixed field length records

2007-10-27 Thread Jim Ault
This won't do the padding, but add extra spaces, yet maybe not as many as you would expect: If the recordBuffer contains: 1 empty => correct number of spaces 2 "Terrific" => the number of spaces + the length of "Terrific" 3 "These are the first words" => (the number of spaces -4 +21) since the

Re: Creating fixed field length records

2007-10-28 Thread Kay C Lan
On 10/28/07, Phil Davis <[EMAIL PROTECTED]> wrote: > > >> put empty into recordBuffer > >> set the itemDelimiter to space > >> # put empty into item of recordBuffer > put space into item of recordBuffer How about: put space into item of recordBuffer repla

RE: Creating fixed field length records

2007-10-28 Thread Rob Cozens
All, put empty into item of recordBuffer Thanks to those who noted this logic comes up one character short. However the better generic fix (IMO) is: put empty into item (+1) of recordBuffer Rob Cozens CCW Serendipity Software Company "And I, which was two fooles, do so gro