Announcement

Collapse
No announcement yet.

Append record in Random-Mode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Append record in Random-Mode

    Hello,

    I´ve opened a file in Random - Mode:

    dim a as shared string *40

    Open "R", 1, "test", sizeof(a)

    then I wanted to append a record to an empty file:

    put 1,lof(1),a$

    I've got an error '63 bad record number' but lof(1) is 0

    and 0 is allowed. I've no option base.. command used.

    Then I've tested:

    seek 1,lof(1) --- the same Error ??? why ???

    Thanks for help. ( In Binäry mode this is no problem )


    Regards

    Matthias Kuhn

    ------------------

  • #2
    No, zero is NOT allowed in RANDOM mode. Frome the help file:

    ¦
    PUT statement (random files) ¦
    ---------------------------- ¦
    Purpose: Writes a record to a random-access file. ¦
    ¦
    Syntax: PUT [#]filenum [, loc] [, var] ¦
    ¦
    'loc' is a numeric expression specifying the record to be written, and ¦
    can range from 1 to 16,777,216. If specified, var is a variable containing¦
    data to write at the record position. ¦
    Zero is OK as a 'loc' for the put verb when using a file opened for BINARY access.

    MCM
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment

    Working...
    X