Xojo2023r3: Analyzer warning on select case

Working on web app conversion from Xojo2018, running Analyze on folowing code:

Dim DataMode As Boolean

Select Case mFaMode 
Case "KEEP"
  DataMode = false
Case "DELETE"
  DataMode = true
End Select

where mFaMode is class property of type FieldString.

I see yellow warning signs on both “Case” lines, the verbiage of the warning is:
“Warning: Converting from Integer to Double causes a possible loss of precision, which can lead to unexpected results.”

Can someone explain to me why am I getting this warning and what it really means?
Thanks

Strange, I copied your code and I don’t get that warning.

I do get one for Integer → Int32 for WebPage1.Name

What is a FieldString? If it is some sort of String it could be possible to do:

Dim DataMode As Boolean

Select Case CType( mFaMode, String )
Case "KEEP"
  DataMode = false
Case "DELETE"
  DataMode = true
End Select
1 Like

Note: mFaMode is defined as StringField

Yeah, I meant StringField.

I didn’t mention: this is on Mac OS Ventura 13.5.1

Maybe will not make a difference but, are you using 2023r3 or 2023r3.1? I used r3.1.

Still not sure what you mean by StringField, its not a Xojo concept. Is it some sort of string, if so that’s fine, my code will solve the problem.

If you are talking about an enum then you should do the following. Assuming the enum is called FaModes:

Dim DataMode As Boolean

Select Case mFaMode
Case FaModes.KEEP
  DataMode = false
Case FaModes.DELETE
  DataMode = true
End Select

Another question, when you say “conversion” did you open the Xojo2018 project with Xojo2023 and you are changing/fixing things or you created a new project with Xojo2023 and you are recreating your web app?

Can you show the definition of “mFaMode” and “StringField”?

Ian,
Sorry, I have just realized I may have opened can of worms. The StringField is a custom structure inherited from the base custom structure Field.
The Field structure has no Super but it has interface DataItem and ListItem (another custom structures). StringField has its own methods and properties. I think the ball is now in my court, I need to see what is going on there then. Thanks anyway.

As the latest is 2023 Release 3.1 you should use that as it fixed a few regressions.