Menu

#1878 SEEK does not affect WRITE position

5.1.0
accepted
Erich
None
tests
1
2023-08-11
2023-03-15
AvdP
No

Using installer ooRexx-5.1.0-12653.windows.x86_32.exe

This code:

filename = 'f1.txt'
rc = lineout(filename, 'xxxxxxxxxxxxxxxxxxxxxx')
rc = lineout(filename, 'xxxxxxxxxxxxxxxxxxxxxx')
rc = lineout(filename, 'xxxxxxxxxxxxxxxxxxxxxx')
rc = lineout(filename, 'xxxxxxxxxxxxxxxxxxxxxx')
rc = lineout(filename, 'xxxxxxxxxxxxxxxxxxxxxx')
rc = lineout(filename)

str = .stream~new(filename)
str~open
str~seek('< 2 write line')
str~charout('.....')
str~close

gives me:

xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
.....

I had expected:

xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
.....xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx

Note that if I change to
str~seek('< 2 line')
I do get the 2nd output.

Discussion

  • Erich

    Erich - 2023-08-11
    • status: open --> accepted
    • assigned_to: Erich
    • Pending work items: none --> tests
     
  • Erich

    Erich - 2023-08-11

    code fix submitted with revision [r12717]

     

    Related

    Commit: [r12717]

Anonymous
Anonymous

Add attachments
Cancel