Console app crashed when using xojo.Core.Date

I’m creating some serverapps running on Windows Embedded Standard 7.
It took some time to find out why the exe was crashing.
Narrow it down it has to be the Date part because when I remove these date lines the app is running fine!

[code]dim f as FolderItem
dim tos as TextOutputStream

dim d as xojo.Core.Date = xojo.Core.Date.Now
dim ds as String

ds=Format(d.Year, “0000”)+"-"+Format(d.Month, “00”)+"-"+Format(d.Day, “00”)

f=GetFolderItem("").Parent.Child(“rM_log_”+ds+".txt")
if f<>nil then
tos=TextOutputStream.Append(f)
else
tos=TextOutputStream.Create(f)
end if

ds=Format(d.Year, “0000”)+_
“-”+Format(d.Month, “00”)+_
“-”+Format(d.Day, “00”)+_
" "+Format(d.Hour, “00”)+_
“:”+Format(d.Minute, “00”)+_
“:”+Format(d.Second, “00”)+_
“.”+Format(d.Nanosecond,“0000”).Left(4)

tos.WriteLine( ds + ": " + “Test” )
tos.Close
[/code]

Except for the use of the nanoseconds you could just use a regular old date

That did the trick, thanks Norman.

Now running our first server app on a very small DIN PC!
I love Xojo :slight_smile: