Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3762

Silent Quit because of a bad date

$
0
0

I am testing a new way (the current one) to deal with dates and get a strange behavior:

the involved date is : 1985-60-72

I had a crash (I tested my date against Nil) in the beginning, then the application silently quit.
I was able to found the bad date using System.DebugLog Row_Idx to get the line where the error lies.
So, I exit the Loop before that value and test all two other dates (in case of another error). There was none.

The used code to read the date is:


// Crée une variable DateTime
Var bDate_Time As DateTime = DateTime.Now // French format: JJ/MM/AAAA

// Asssigne la date de naissance à la variable
bDate_Time = row.Column("Date_Birth").DateTimeValue
If bDate_Time <> Nil Then
  // Affiche la date à la française (JJ/MM/AAAA)
  Liste.CellTextAt(Row_Idx,7) = bDate_Time.ToString(French_Loc, DateTime.FormatStyles.Short, DateTime.FormatStyles.None)
  
Else
  System.DebugLog "Mauvaise date: " + row.Column("Date_Birth").StringValue
End If

For the Record.

SQLite
Xojo 2024r4.2
Sequoia 15.3.2

6 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 3762

Trending Articles