Google Maps API alternative

  1. ‹ Older
  2. 3 months ago

    Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands

    @Paul L Can you elaborate?

    -image-

    Demo EEDesktop - just loaded from the Examples-folder and hit Run.

  3. Paul L

    Jan 10 Xojo Inc http://docs.xojo.com

    Weird. I am definitely not seeing that error in 2018r4.

    However, it looks like the "invoiceNum" parameter is already a String so the Str method is not needed there. I'm not sure why it would be causing an error for you, though.

  4. Ulrich B

    Jan 10 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    There were some versions where str(aString) would lead to such an error. What data type is invoiceNum?

  5. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands

    @Paul L / @Ulrich B

    -image-

    At least on Windows you cannot throw a string into a Str function

    -image-

    So, since invoiceNum is already a of type string , you just should remove the Str here and the problem is fixed.

    And, weird, the documentation says the value of the Str function goes as a variant, but you can only use value types Boolean, Date or Color.

  6. Tim P

    Jan 10 Pre-Release Testers Austin, TX

    This is a great example of why I like variable type prefixing. "invoiceNum" implies that it's a numeric value, but it's a String! Sure it's just a small oversight here, but with a consistent variable naming policy that includes variable type it would have been clear from the start ;)

    It's a good practice to get into the habit of, and may save you some head scratching in larger, non-example projects!

  7. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands
    Edited 3 months ago

    Exactly: sInvoiceNum would be better.

  8. Kem T

    Jan 10 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    With a strongly typed language like Xojo, I think that's unnecessary, inconvenient, and harder to read.

    Just an opposing viewpoint.

  9. brian f

    Jan 10 Pre-Release Testers, Xojo Pro Chilly California
    Edited 3 months ago

    @Joost R Exactly: sInvoiceNum would be better.

    DIM ThisReallyIsaStringNotaNumberInvoiceNumber As String :P

  10. Tim P

    Jan 10 Pre-Release Testers Austin, TX
    Edited 3 months ago

    @Kem Tekinay With a strongly typed language like Xojo, I think that's unnecessary, inconvenient, and harder to read.

    Unnecessary and inconvinient like your over-spacing around parens? ;)

    @brian f DIM ThisReallyIsaStringNotaNumberInvoiceNumber As String :P

    Better and more descriptive than some of the variable names we see around here :)

    (Style is all opinion! Mine is that type prefixing is super helpful and useful.)

  11. Bob K

    Jan 10 Pre-Release Testers, Xojo Pro Kansas City

    @Kem T With a strongly typed language like Xojo, I think that's unnecessary, inconvenient, and harder to read.

    Just an opposing viewpoint.

    As long as you're consistent and it makes sense to you, your clients not only now but to your future selves then you're good. Also throw in other people that will have to fix something in your code years down the road.

    But, I'd also agree that sInvoiceNum, or some variation thereof, is better because looking strictly at code (not having your mouse over it) it is impossible to tell what invoiceNum is. I like being able to tell at glance what the datatype is. And yes this means if you change it from string to integer for some reason you must change the prefix - it's not that hard - really.

    This is almost religious war material so you be you. Peace.

  12. Kem T

    Jan 10 Pre-Release Testers, Xojo Pro, XDC Speakers New York

    @Bob K This is almost religious war material so you be you.

    "Almost"?

    :P

  13. Ulrich B

    Jan 10 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    @Paul L I'm not sure why it would be causing an error for you, though.

    Because the docs say Str() expects "any numeric, Boolean, Date or Color expression". Which a string is not (necessarily). IMHO the compiler should complain here.

  14. Joost R

    Jan 10 Pre-Release Testers, Xojo Pro The Netherlands

    Hmm .. it was not my intention to pollute this thread about Maps with a discussion about using prefixes and a bug in demo-code.

    But, since this thread is already far off straight track, I must say I don't like not being able to run a demo program right away without being stopped by compiling issues. Think this demo application was probably not very well tested on the Windows platform. Keep in mind that newbies wouldn't know what to do here.

    Let's close here... summarized I am most happy with the discovery of Mapbox , which is a great free mapping solution.

  15. Ulrich B

    Jan 11 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    @Joost R Think this demo application was probably not very well tested on the Windows platform.

    Let me add one point of self-correction:
    I think I was wrong saying some versions of Xojo show this error.
    Could it be you are using plugins? If I remember correctly, the error does not appear with a clean installation of the IDE.
    And now I am silent here too.

  16. Joost R

    Jan 11 Pre-Release Testers, Xojo Pro The Netherlands

    @Ulrich B Could it be you are using plugins?

    Yes, I have some MBS plugins loaded which fill in what Xojo doesn't provide currently, so no chance to go without. But anyway, this Str function was needles here.

  17. Paul L

    Jan 11 Xojo Inc http://docs.xojo.com

    @Joost R But, since this thread is already far off straight track, I must say I don't like not being able to run a demo program right away without being stopped by compiling issues. Think this demo application was probably not very well tested on the Windows platform. Keep in mind that newbies wouldn't know what to do here.

    To be clear, the EEDesktop sample is (among many other things) run on Mac, Windows and Linux for every Alpha, Beta and Release version before it is posted. This unnecessary usage of Str() has been there at least since 2013r1 and I have never seen it cause an error on run. So it would seem something else is at play. Regardless, I've removed the Str() usage in that method (from both EEDesktop and EEWeb) for 2019r1. :)

  18. Joost R

    Jan 11 Pre-Release Testers, Xojo Pro The Netherlands

    @Paul L To be clear, the EEDesktop sample is (among many other things) run on Mac, Windows and Linux for every Alpha, Beta and Release version before it is posted.

    @Paul L - sorry Paul, I did not intend to blame anyone and I appreciate appropriate acting and improvement. Thx.

  19. Hal G

    Jan 11 Pre-Release Testers, Xojo Pro, XDC Speakers CampSoftware.com

    @Paul L This unnecessary usage of Str() has been there at least since

    Should passing a string into str throw an error on compiling?

  20. Paul L

    Jan 11 Xojo Inc http://docs.xojo.com

    @Hal G Should passing a string into str throw an error on compiling?

    I'd guess it probably cannot be a compile error since technically Str() takes a Variant. But I'm not the expert of such things. If this is something you'd like to see, do create a Feedback case.

  21. Hal G

    Jan 11 Pre-Release Testers, Xojo Pro, XDC Speakers CampSoftware.com

    @Paul L I'd guess it probably cannot be a compile error since technically Str() takes a Variant. But I'm not the expert of such things. If this is something you'd like to see, do create a Feedback case.

    Since Str takes a Variant, then it seems there should be no compile error. :)

    Thanks!

or Sign Up to reply!