|
Post by wexhammer on Jan 15, 2020 6:56:33 GMT -5
How would a rid the string$ of content appearing on one line?
The code below contains some text, on save i would prefer the string$ to save as multi lined.
At the moment when saving as a .txt file, upon opening its all one line. How would i rid this?
' turn main window off nomainwin
' specify text to display
space$ = "<style>"; CHR$(13); _ ".invoice-box {"; CHR$(13); _ " max-width: 800px;"; CHR$(13); _ " margin: auto;"; CHR$(13); _ " padding: 30px;"; CHR$(13); _ "border: 1px solid #eee;"; CHR$(13); _ "box-shadow: 0 0 10px rgba(0, 0, 0, .15);"; CHR$(13); _ "font-size: 16px;"; CHR$(13); _ "line-height: 24px;"; CHR$(13); _ "font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;"; CHR$(13); _ "color: #555;"
' set up the GUI statictext #m.txt, Message$, 10, 10, 200, 100 button #m.save, "Save", [save], UL,10, 150, 30, 30 ' open the window open "Multi-Line Message Demo" for window as #m
' trap closing the window, this line is mandatory #m "trapclose [quit]"
' wait for user action wait
[save] filedialog "Save","*.html",sfile$ if sfile$="" then wait open sfile$ for output as #f txt$=space$ print #f, txt$ close #f wait
[quit] ' close the window and terminate close #m end
|
|
|
Post by tsh73 on Jan 15, 2020 7:13:50 GMT -5
try replace CHR$(13) to CHR$(13)+CHR$(10)
|
|
|
Post by wexhammer on Jan 15, 2020 7:18:14 GMT -5
Cheers!
|
|