Welcome guest, is this your first visit? Click the "Create Account" button now to join.
Results 1 to 10 of 29

Hybrid View

  1. #1
    Member
    Join Date
    Apr 2016
    Location
    Brussels
    Posts
    15
    Rep Power
    0

    Default

    Quote Originally Posted by lunapark View Post
    IAfter a return in different versions, it turns out that the function described as falling under a widestring is in fact a boolean, we find the same line in the address.lua of Primo where it is less complicated to display a simple dialogue
    sc_InfoMessageBox(type(MODEL.address.search.support_streetsearch_in_state(AddressSearchResult.selectedCountry)),1)
    returns a boolean type as expected, so no modification needs to be made at this level
    You are (again) 100% right. There is some corruption in the LUA code that changes the country string (pointer) by one byte.
    Code:
    Please Login or Register to see the links
    works.
    Code:
    Please Login or Register to see the links
    crashes (real crash).

    Now I need to find why the address that is correct right before the function containing the code gets increased by one byte. I already solved a similar issue whether a function was missing a "self" argument.
    These are probably delicate locations where LUA code calls C-code.
    Will get there ... eventually. Thanks for all the help and the tip on sc_InfoMessageBox (very useful).

  2.    Advertissements


  3. #2
    Master
    Join Date
    Nov 2017
    Location
    europa
    Posts
    123
    Rep Power
    245

    Default

    this seems to be what the old scripts did

    local selCountry = MODEL.map.cursor.address.country() --> "_BEL"
    if selCountry ~= "" then
    AddressSearchResult.selectedCountry = selCountry:sub(2, 4) --> "BEL"
    if AddressSearchResult.selectedCountry:sub(2, 2) == "*" then
    selState = MODEL.map.cursor.address.state()
    if selState ~= "" then
    AddressSearchResult.selectedCountry = selState:sub(2, 4)
    gSavedSelectedState = AddressSearchResult.selectedCountry
    else
    gSavedSelectedState = nil
    end
    end
    .....
    AddressSearchResult.streetsInState = MODEL.address.search.support_streetsearch_in_state(AddressSearchResult.selectedCountry) --> "BEL"
    About sc_InfoMessageBox (very useful).

    need to be used as it to obtain a visible result
    sc_InfoMessageBox("Result: /"..tostring(type("very useful").."/") --> /USERDATA/ , /STRING/ , /NIL/ ,......

  4. #3
    Member
    Join Date
    Apr 2016
    Location
    Brussels
    Posts
    15
    Rep Power
    0

    Default

    Quote Originally Posted by lunapark View Post
    this seems to be what the old scripts did
    That is also what I have. But even when I put the constant string "BEL", it crashes. Same with "FRA" etc. It does not crash with "USA" but also returns false, but than again I don't have USA maps loaded.
    Anything with an underscore goes, but always returns false. I also tried with a local variable (also with wide string): always crash.
    Interestingly, when I put the country in lower case, it does not crash and again returns false. Function "sc_HasCountryStates" seems to imply that countries with states start with a lower case.

    Look like it requires some additional code like
    Code:
    Please Login or Register to see the links
    or classic search backend code is broken for LUNA since I have other unexplained crashes...

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •