File/Writeline/FPTR Functionality and Purpose

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

  • File/Writeline/FPTR Functionality and Purpose

    Hey folks, hope everyone is doing well here.

    Question: I've got an error coming up that makes me press enter whenever I am dimensioning a part. The error reads "Cannot save to a file that has not been opened" with the only option being "OK."

    Now normally, this wouldn't be an issue, however it is happening on over 100 characteristics. Pressing OK 100 times every time I run these parts is getting extremely old and frustrating. I've narrowed it down to a couple of things, however I'm not entirely sure, and I'd like to understand the functionality of the Writeline command. I believe that this command is what is causing my issue, but i don't want to take it out of the program without fully understanding what it is for.

    I've looked in the index, and I've checked a few of the forum posts, but nothing comes out 100% clear to me what this command does. Any explanation would be appreciated!

    Code:
    FILE/WRITELINE,FPTR,VR.1+","+VR.3+","+VR.1.MEAS+","+VR.4+","+VR.2+","+VR.4

  • #2
    It is trying to use the built in FILE I/O commands to write select information to a text file, as was coded by who-eer programmed this routine. There needs to be a corresponding FILE/OP (before) as well as a FILE/CLOSE (after) in this same routine for the FILE/WRITELINE to work

    Comment


    • #3
      Originally posted by Don Ruggieri View Post
      It is trying to use the built in FILE I/O commands to write select information to a text file, as was coded by who-eer programmed this routine. There needs to be a corresponding FILE/OP (before) as well as a FILE/CLOSE (after) in this same routine for the FILE/WRITELINE to work
      Hey Don, thanks for the response! I inherited this program, along with a few others. I've never used the Writeline command in any other program I've written, and it isn't present in all of the programs I've inherited.

      So just so we're clear, I can delete these commands because there isn't a file created for this to write to, so it isn't recording anything currently, correct? If i delete these commands, it shouldn't affect the performance of the program (aside from having to hit enter 100 times every time i run this program)?

      Comment


      • Don Ruggieri
        Don Ruggieri commented
        Editing a comment
        Correct, in theory. I don't know why they were there in the first place. I don't know if they try to re-read the contents of the file that is written, or use them elsewhere in the same PRG or others, but you should be ok. Just make a backup copy first.

    Related Topics

    Collapse

    Working...
    X