Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mac print #file crlf?
#1
Two questions:

First, should I be entering an issue over on github for this sort of thing?

Second: Running on Mac I'm printing to a text file and the end of line is crlf but should be lf. I see that the doc says print will add a crlf. Is there any way to turn this off. I started looking at the C++ code and decided this was one I couldn't begin to tackle on my own Smile
Reply
#2
Are you using PRINT #LFN,

   If so do this

           PRINT #LFN, "MYCONTENT";CHR$(10);

Terminating with a semi-colon will suppress the Automatic Line terminator then just insert the correct one
With CHR$(10)

even easier

CONST LF = CHR$(10)

                      PRINT #LFN, "MYCONTENT";LF;
Reply
#3
Even easier:

Code: (Select All)

SUB PrintOut (where as long, text$)
   PRINT #where, text$ + CHR$(10);
END SUB

Then just:

PrintOut #LFN, "Whatever you want"
Reply
#4
(02-15-2026, 11:17 PM)SMcNeill Wrote: Even easier:

Code: (Select All)

SUB PrintOut (where as long, text$)
   PRINT #where, text$ + CHR$(10)
END SUB

Then just:

PrintOut #LFN, "Whatever you want"
This is in error Steve .    You still need the semi-colon after the CHR$(10) Then it will work properly.   
The way yours is written will end up   "CONTENT" 10,13,10  !!!!


Also by just using Print #LFN instead of this you can send any variable type.    Your's REQUIRES a string 
This isn't hard, I have a couple routines modeled similiarly, but it's still an extra step.
Reply
#5
Whatcha talking about?  Steve is Amazing!  He'd never leave out a semicolon or whatnot.  

And he'd never go back and edit a post to make it seem like he was right all along either!  Ignore that Edited by above... I have no idea where it came from.  Big Grin
Reply
#6
(02-15-2026, 11:11 PM)ahenry3068 Wrote: Are you using PRINT #LFN,

   If so do this

           PRINT #LFN, "MYCONTENT";CHR$(10);

Yes I am. For some reason when I started trying to figure this out yesterday I looked at Write but that loses some Print functionality.

Anyway, this gets the job done. Thanks to both you and Steve.

Additional background in case anyone else runs into this:

I only noticed the crlf because I was doing some diffs. MacVim and Terminal are both smart enough that the extra cr isn't really causing a problem beyond the diff. I don't run Linux but I assume similar issues would need similar solutions.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Mac debugger not connecting, a user error! BlameTroi 0 99 02-07-2026, 06:18 PM
Last Post: BlameTroi
  Mac current release sigabrt BlameTroi 3 219 02-05-2026, 02:26 PM
Last Post: a740g
  Joysticks on a Mac, _DEVICEINPUT() NakedApe 15 1,696 01-01-2026, 04:05 PM
Last Post: pmackay
  Print strings with accents and special chars Ikerkaz 8 678 12-20-2025, 09:28 PM
Last Post: TempodiBasic
  QB64pe 4.0 on Mac Troubles NakedApe 14 2,231 12-29-2024, 01:53 AM
Last Post: NakedApe

Forum Jump:


Users browsing this thread: 1 Guest(s)