Creating fixed field length records

Jim Ault JimAultWins at yahoo.com
Sat Oct 27 19:21:30 EDT 2007


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 there are already 4 items in the phrase

another method would be to
--68 spaces needed
put empty into recordLength
put space into line <record length-1> of recordLength
replace cr with space in recordLength


Jim Ault
Las Vegas

On 10/27/07 8:51 AM, "Rob Cozens" <rcozens at pon.net> wrote:

> Hi Len,
> 
>> While I'm at it, if I DO have to create a string of <record length>
>> first, how do I create a string of spaces <record length> long?
> 
> Another approach:
> 
>          put empty into recordBuffer
>          set the itemDelimiter to space
>          put empty into item <record length> of recordBuffer
> 
> Rob Cozens CCW





More information about the use-livecode mailing list