Throwing a Date in IDE via Editing a value?

Desktop Mac.

I thought if could edit a value in the IDE, I could throw a date, but apparently not. How do I do this?
StDte is a DateTime property.
Try
If ts.IsEmpty = False Then StDte = DateTime.FromString(ts)
catch …

If I edit the value of the string from an SQLDateTime value to anything, it doesn’t throw an error. I this something that doesn’t work or do I do it differently?

Hi Arthur. I made the following function in a module:

Public Function ToDateTime(extends s as String) as DateTime
  if s.IsEmpty = False then
    Return DateTime.FromString( s )
  end if
End Function

I then called it like this:

var dString as String = "Asdfas" //"2010-10-01 01:22:55"
var d as DateTime = dString.ToDateTime
Break

When dString contains invalid data, at least in my testing, a RuntimeException is thrown in 2020r1.2:

Sorry. I thought I was being clear by the word edit. When you debug, you can see the value, but you also have the opportunity to edit the value before it is used.
I thought by changing the value before it is used would result in an error.
I edited the value for a string before it was converted to a date, but it didn’t throw an error.
To prove it would throw I went and edited the text to be read in and it threw an error.

This Edit is part of the Watch window.

<https://xojo.com/issue/62652>
Editing String for conversion to Date in watch has no effect

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.