Help with Doc for IOS programing

  1. 7 weeks ago

    Alexis C

    Feb 13 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    Hi
    Where i can find programing doc like for how i do Format(var,"##,##0.00") and other intruction that support IOS

  2. Tim P

    Feb 13 Pre-Release Testers, Xojo Pro Rochester, NY

    I'm not certain there's a document like that. It's also really hard to find information about the namespaced framework in the wiki. You kind of have to already know what you're looking for, which doesn't help much.

    In the namespaced framework, Format became a function of the number you're trying to convert.
    https://docs.xojo.com/Double.ToText
    https://docs.xojo.com/Integer.ToText

    Good luck!

  3. Alexis C

    Feb 13 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    look my code but no works

    Var er As Text

    Try
    Rs=App.DBConn.SQLSelect(SqlStr)
    Catch e As iOSSQLiteException
    //ErrorLabel.Text = e.Reason
    er= e.Reason
    End Try

    If Rs.RecordCount > 0 Then
    Var TotalBalence As Double
    try
    TxtNumSocio.Text=Rs.Field("DataSocioNum").TextValue
    TxtNombre.Text=Rs.Field("DataNombre").TextValue
    TxtDistrito.Text=Rs.Field("DataLocate").TextValue
    TxtTel.Text=Rs.Field("DataCellphone").TextValue
    TxteMail.Text=Rs.Field("DataeMail").TextValue

    TotalBalence=Rs.Field("DataBalance").CurrencyValue <<<<< crash or using DoubleValue same error

    Label8.Text="Balance Acc :" + TotalBalence.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")

    TxtActiveYesNo.Text="Activo"

    TxtBuscar.Text=""
    catch e As iOSSQLiteException
    er=e.Reason
    end try
    End If
    Rs.Close

  4. Alexis C

    Feb 13 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    error is This field is not representable as an Integer

    Var er As Text

    Try
    Rs=App.DBConn.SQLSelect(SqlStr)
    Catch e As iOSSQLiteException
    //ErrorLabel.Text = e.Reason
    er= e.Reason
    End Try

    If Rs.RecordCount > 0 Then

    try
    TxtNumSocio.Text=Rs.Field("DataSocioNum").TextValue
    TxtNombre.Text=Rs.Field("DataNombre").TextValue
    TxtDistrito.Text=Rs.Field("DataLocate").TextValue
    TxtTel.Text=Rs.Field("DataCellphone").TextValue
    TxteMail.Text=Rs.Field("DataeMail").TextValue

    //TotalBalence=Rs.Field("DataBalance").DoubleValue.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")

    Label8.Text="Balance Acc :" + Rs.Field("DataBalance").DoubleValue.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")

    TxtActiveYesNo.Text="Activo"

    TxtBuscar.Text=""
    catch e As iOSSQLiteException
    er=e.Reason
    end try
    End If
    Rs.Close

  5. Tim P

    Feb 13 Pre-Release Testers, Xojo Pro Rochester, NY

    Is the DataBalance column defined as an INTEGER in the database?

  6. Alexis C

    Feb 13 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    nop is double

  7. Tim P

    Feb 13 Pre-Release Testers, Xojo Pro Rochester, NY
    Edited 7 weeks ago

    Okay, according to the SQLite docs, that's valid https://www.sqlite.org/datatype3.html
    Something is going wrong with the type. You would have more information to work with by breaking out the single line doozey into multiple variables.

    Where does this sample code break and how? Is it a iOSSQLiteException?

    dim tdDataBalance as Double = Rs.Field("DataBalance").DoubleValue
    dim ttxFormatted as Text = tdDataBalance.ToText(Xojo.Core.Locale.Current, "#,###.##0.00")
    Label8.Text="Balance Acc :" + ttxFormatted
  8. Alexis C

    Feb 13 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    Hi
    I use you code and same error This field is not representable as an Integer

    If any sqlite editor to check i am using valentina studio

  9. Tim P

    Feb 13 Pre-Release Testers, Xojo Pro Rochester, NY

    Which line it erred on is important and will tell you whether you have a database or framework problem.

  10. Alexis C

    Feb 13 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    it crash in this line dim tdDataBalance as Double = Rs.Field("DataBalance").DoubleValue
    ok

    how i convert from text to double so i can use two variable.
    Dim Mybalance as text=Rs.Field("DataBalance").textvalue
    Dim Balance as Duble=Mybalance. ?

    then show the data on the screen
    Label8.Text="Balance Acc :" + ttxFormatted

  11. Tim P

    Feb 13 Pre-Release Testers, Xojo Pro Rochester, NY
    Edited 7 weeks ago

    @Alexis Colon Lugo it crash in this line dim tdDataBalance as Double = Rs.Field("DataBalance").DoubleValue
    ok

    I would think that means the database you're accessing has the a different data type for that column.

    @Alexis Colon Lugo how i convert from text to double so i can use two variable.
    Dim Mybalance as text=Rs.Field("DataBalance").textvalue
    Dim Balance as Duble=Mybalance. ?

    I would ask that you check the documentation I linked above. You can reach the answer in two clicks. Granted, you have to know what they are - but exploring the documentation cannot hurt you at all. If you need step by step guidance, send me an email and we can discuss your needs privately.

or Sign Up to reply!