This subroutine will save the regular data of the given buffer as is into the specified file. Any set markers and find data are not part of the regular data, hence they don't get saved to the file. An existing file with the same name will be overwritten.
The buffer itself remains completely unchanged and in same state regarding the current buffer position, markers, find data and active line endings logic, hence you could easily setup an auto-save via a timer and after save go on working with the buffer.
SYNTAX:
BufToFile buf$(), fileSpec$
INPUTS:
buf$() (STRING array)
- This is the array of any existing and initialized buffer, which shall be written into the file. The buffer may still be empty, which would write an empty file then.
fileSpec$ (STRING)
- The name of the file to save the buffer into. You may also add a path, if required. Make sure any specified path exists to avoid errors.
NOTES:
- If you save a pure text file and want the line endings suitable for a specific OS, then you may want to call the appropriate conversion subroutine ConvBufToNativeEol(), ConvBufToWinEol() or ConvBufToLnxMacEol() right before calling this function.