MapInfo Pro Developers User Group

Expand all | Collapse all

MapBasic Dialog issue when displaying numbers in EditText control

Jump to Best Answer
  • 1.  MapBasic Dialog issue when displaying numbers in EditText control

    Posted 29 days ago
      |   view attached

    I have been seeing some odd results when using the Dialog function in MapBasic.  I see these results in MI v2019.3, but not v2017.

    Within my MapBasic program, I carry out the following:

    1. From the currently selected record, retrieve the contents of the first four fields.

    2. Display the contents within Dialog EditText controls.

    Result: those fields that contain numbers are not displayed properly.  Often the EditText control is blank.  Other times they contain seemingly random text such as "sample" and "&foreground", which indicates to me that the wrong memory location is being referenced.

    To replicate this, see the attachment.  To use this:

    1. Open form_sample.TAB in MapInfo 2019.3.

    2. Select a record from the form_sample table in MapInfo.

    2. Run form_sample.MBX

    The contents of the four fields for the record you have selected will be printed to the Message window.  Also, a Dialog will be opened where the contents should be displayed.

    If you run this in 2017 it works, but in 2019.3 it does not.  The mbx is compiled in v2017 but I have also compiled it in v2019 with the same result.

    If I change my code to add a character (e.g. "A") to the beginning of the number, before displaying it in the Dialog, it works.  Note that I am using a string variable to store the contents.



    ------------------------------
    James Nolet
    Dooley Mitchell & Morrison Pty Ltd
    Mentone, VIC, Australia
    ------------------------------

    Attachment(s)

    zip
    form_sample.zip   2 KB 1 version


  • 2.  RE: MapBasic Dialog issue when displaying numbers in EditText control

    Posted 24 days ago

    Hi James

    Have you raised this issue with our support? If not, I'd suggest you do.

    I can replicate the issue. I have tried changing the way the program accesses the values from the table but that doesn't seem to make any difference.

    Also, as you state yourself, the values look fine in the Message window but not in the EditText controls. And you are right, adding a letter for example "A" in front of the number seems to make it work.

    Even though they are numbers the table and the application are treating these values as strings so I wonder why the EditText control treats them differently.

    But as I said, pass it onto our support at software.support@precisely.com.

    Thanks



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: MapBasic Dialog issue when displaying numbers in EditText control

    Posted 24 days ago

    Hi Peter,

    Thanks for checking this for me.  I thought I must have been doing something wrong or retrieving from a corrupt table before I realised it came down to the EditText control itself.  I'll raise this issue with support as you suggest.



    ------------------------------
    James Nolet
    Dooley Mitchell & Morrison Pty Ltd
    Mentone, VIC, Australia
    ------------------------------



  • 4.  RE: MapBasic Dialog issue when displaying numbers in EditText control
    Best Answer

    Posted 22 days ago

    Hi James,

    Your support case has been actioned and escalated to the engineering team for further advice.
    Thanks for the feedback - appreciated.

    Kind Regards,



    ------------------------------
    Terry Hunt
    Software Support Analyst
    Precisely
    Sydney, Australia
    ------------------------------
    ------------------------------