Results 1 to 7 of 7

Thread: strange thing happening....file_save is not overwriting...help file says it should.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    Mar 2024
    Posts
    17
    Rep Power
    2

    [FIXED, dont look please] strange thing happening....

    strange thing happening....file_save is not overwriting...help file says it should.

    n = FILE_Save(APP_SCRIPTPATH & "test.txt", out_string)

    the above is the lat line of the script function.
    the help file says:

    quote
    If FileName already exists, FileName will be deleted before writing StringBuffer
    /quote

    that is not happening for me. the string is appended (added to) the file at the bottom.
    I expected the file to be over written. the system pauses for 2 seconds during the file write, seemed odd for 10 lines of text, but not critical.

    I was running in debug. i also tried just executing the script also.
    I deleted the file. ran the script 2 times.
    windows 10
    --------------------------------------------------------------------------
    made an example


    calling "save_file" while inside include file will append the text to the file..
    calling "save_file" from the main script file will overwrite the file
    I commented the code in main file and ran the function 2 times, it adds to file
    I un-commented code and commented function and ran 2 times. it over writes.
    pausing in between to the 2 writes a few seconds.
    code in the include file is inside function. code in main script file is not in a function.

    USES "FILE"
    
    Dim FileHandle As DWORD
    Dim Status     As DWORD
    Dim TestString As String
    Dim FileName   As String 
    Dim sMsg       As String
    
    TestString = "1234567890ABCDEF"           ' String to write to file
    FileName   = APP_SCRIPTPATH + "test.txt"  ' Build filename
    
    Status     = FILE_SAVE(FileName, TestString)   ' Save string to File
    
    Attached Files Attached Files
    Last edited by F_Dixon; 26-04-2024 at 05:21. Reason: EDIT to say I fixed it.

Similar Threads

  1. May I suggest a little thing.
    By dco045 in forum thinBasic General
    Replies: 1
    Last Post: 07-02-2024, 07:48
  2. the github-thing
    By ReneMiner in forum thinBasic General
    Replies: 4
    Last Post: 30-08-2020, 14:53
  3. CHOOSE and CALL used to do the same thing
    By marcuslee in forum Sources, Templates, Code Snippets, Tips and Tricks, Do you know ...
    Replies: 1
    Last Post: 09-09-2008, 07:01
  4. Intel Atom: the next big thing
    By ErosOlmi in forum Technology
    Replies: 1
    Last Post: 30-05-2008, 23:22
  5. Every Thing But VB6?
    By sfbm in forum Other languages SDK development
    Replies: 6
    Last Post: 06-01-2008, 22:38

Members who have read this thread: 5

Posting Permissions

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