Switch to desktop version  
Newline in PUT - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: BASIC Script (https://techforum.ewon.biz/forum-52.html)
+--- Thread: Newline in PUT (/thread-557.html)



Newline in PUT - jonteohr - 26-03-2018

Hi,
I'm trying to append a log message to a file of mine inside the /usr/ folder.
This is my code:
Code:
OPEN "file:/usr/testLog.txt" FOR BINARY APPEND AS 1
 PUT 1, TIME$ + " " + $szMessage$
CLOSE 1

However, I would like to make it so that each time this appends a message to the file, it does it on a new line. Sadly \n did not seem to work. How can I achieve this?


RE: Newline in PUT - AngelaT - 26-03-2018

End your line with CHR$(13)+CHR$(10) (Carriage Return/Line Feed)