Blank Lines At Start Of New File [SOLVED]

Just starting out? Need help? Post your questions and find answers here.
jayand
User
User
Posts: 22
Joined: Sat Mar 04, 2023 12:55 pm

Blank Lines At Start Of New File [SOLVED]

Post by jayand »

I've hit a road block with a very simple piece of code. In the code below In the created file the first line has 1 space & the 2nd line has 2 spaces, while all the other lines are written correctly. If this is normal how can I prevent the seeming blank lines being created, if not what am I doing wrong?

Code: Select all

InDir.s =    ; Choose your own directory
OutFile.s =  ; Choose your own path & file name

CreateFile(1, OutFile)
If ExamineDirectory(0, InDir, "*.*")
	While NextDirectoryEntry(0)
	  WriteStringN(1, DirectoryEntryName(0))
	Wend
	FinishDirectory(0)
EndIf
CloseFile(1)
Last edited by jayand on Tue Jul 11, 2023 7:46 pm, edited 1 time in total.
User avatar
mk-soft
Always Here
Always Here
Posts: 6207
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Blank Lines At Start Of New File

Post by mk-soft »

Could it be that your monitor resolution is too large 8)

First line one dot (directory entry to own directory)
Second line a double dot (directory entry to parent directory)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
infratec
Always Here
Always Here
Posts: 7584
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Blank Lines At Start Of New File

Post by infratec »

This are no spaces:
.
..
That's normal for a directory.
They are placeholders for the directory itself and the parent directory.

If you want to eliminate them, test the directoryname for "." or ".." befoe you write it.
jayand
User
User
Posts: 22
Joined: Sat Mar 04, 2023 12:55 pm

Re: Blank Lines At Start Of New File

Post by jayand »

mk-soft wrote: Tue Jul 11, 2023 7:07 pm Could it be that your monitor resolution is too large 8)

First line one dot (directory entry to own directory)
Second line a double dot (directory entry to parent directory)
No, the monitor I am currently using is a basic 22" 1920x1080
I should have remembered those 2 directory entries, thanks for reminding me.
Post Reply