Notes
The unit Strwrap1 contains many useful string, file, and functions that can be used in web programs. It is a very compact and lean unit since it does not rely on sysutils or classes.
At current time of writing you can download the latest version of strwrap1 here:
Some of the most notable functions in the unit are StrSaveFile and StrLoadFile. These functions act as stringtofile and filetostring functions (strtofile, string2file, file2string, filetostr).
Other notable functions are:
- OpenFileRead (alternative than using assign/reset .. does it in one shot))
- OpenFileReWrite (alternative to using assign/rewrite .. does it in one shot))
- OpenFile (alternative to using assign/rewrite/reset .. does it in one shot)
- MakeDir (make directory in one shot, hiding IORESULT code bloat)
- ReadChunk
- SaveChunk
- GetLineCount (quick easy way to find out amount of lines in a file)
- FindLine
- GetFileSize (quick easy way to determine file size)
- StrLoadFile
- StrSaveFile
- StrLoadLns (load specific lines of a file into string)
- StrLoadRng
- GetLn1 (get line one from a file into a string)
- GetLn2
- GetLnN (get specfic line number from a file into a string)
- ArrayLoadFile (load file into an array of strings)
- ArrayLoadLns
- ArrayLoadRng
- GetLastLns (example: useful for Tail programs that monitor a log file)
- RemoveDupStrings (from an array of strings)