Page 1 of 1

Blank Lines At Start Of New File [SOLVED]

Posted: Tue Jul 11, 2023 6:47 pm
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)

Re: Blank Lines At Start Of New File

Posted: Tue Jul 11, 2023 7:07 pm
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)

Re: Blank Lines At Start Of New File

Posted: Tue Jul 11, 2023 7:17 pm
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.

Re: Blank Lines At Start Of New File

Posted: Tue Jul 11, 2023 7:43 pm
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.