Alpha Video Training
Results 1 to 2 of 2

Thread: file.write v. file.write_line

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    786

    Default file.write v. file.write_line

    I'm trying to save the values set in an array to a disk file when a form is closed and then re-load them each time the form is loaded.
    so far so good:

    OnActivate script (on Form)

    script_play("macro_file_read") see attached

    OnExit script (on form)

    script_play("macro_file_write") see attached

    OnKey script (on form)

    see attached record_macro.txt

    the form has an embedded browse which I am editing making use of macros assigned to keys(hence the onkey script above). I want to save the key definitions between sessions.

    It appears to work for a while then starts getting corrupted after about 6 uses. closing the form and re-opening allows me to continue for a few more.

    my question is, should I be using file.write() and file.read() or file.write_line() and file.read_line()? for saving values in an array, remembering that these are all keystrokes?

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,310

    Default RE: file.write v. file.write_line

    Graham,

    Could not see your attached scripts.

    Here's something to check:

    You may need to redim() the array each time, instead of dim(). Check the xbasic ref. manual for the difference. I've found redim() useful if the array is used over and over again in an application.

    -- tom

Similar Threads

  1. text file write problem
    By Mike Vance in forum Alpha Five Version 6
    Replies: 4
    Last Post: 12-21-2004, 08:23 AM
  2. Help with write to file
    By Peter Lear in forum Alpha Five Version 5
    Replies: 3
    Last Post: 02-13-2003, 11:31 PM
  3. file write command
    By fgpylant in forum Alpha Five Version 4
    Replies: 2
    Last Post: 02-08-2002, 04:54 PM
  4. urgent.. Help can't write to the .dbf file
    By abe kravetz in forum Alpha Five Version 4
    Replies: 1
    Last Post: 10-17-2001, 10:51 PM
  5. urgent.. Help can't write to the .dbf file
    By abe kravetz in forum Alpha Five Version 4
    Replies: 0
    Last Post: 10-17-2001, 01:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •