MapInfo Pro Developers User Group

 View Only
Expand all | Collapse all

select? into using hide token

Simon Emmanuel

Simon Emmanuel10-04-2017 18:03

  • 1.  select? into using hide token

    Employee
    Posted 09-16-2017 15:36

    select? into using hide token

    Here is something I just uncovered this week while investigating a performance issue. When doing a "select into" mapbasic statement Pro supports adding the "hide" token like this:

    select * from TableName into TempTableName noselect hide

    (The hide token is currently undocumented but we will be adding it to the help soon.)

    Using "hide" can be useful if there is no reason for the end user to see the table you are creating as a result of the select into statement. When you use hide the table will not show up in the UI (tablelist or explorer window, sql select dialog, any where we show a list of tables).

    In the customer issue we found that Pro is taking too much time refreshing the table list after a table is opened or closed, especially with many tables open. The customers app was doing a select into over and over again into a temporary table that the user did not need to see. The workaround was to use the hide token. This solved the problem because the tablelist window does not show hidden tables so the performance problem was avoided.

     

    (We do expect to fix the underlying issue with the tablelist).

     

    -Bob



  • 2.  RE: select? into using hide token

    Employee
    Posted 09-16-2017 15:58

    That's a neat little things and good to know. I'm mostly using the Select ..Into construction when doing a loop and in this case the users should never see the resulting query - very often the query table only exists for a very short period of time so adding it to the interface really doesn't make sense.

    I'll definitely start adding the Hide token to my queries where the result isn't for the end user.

    Thanks for sharing, Bob.



  • 3.  RE: select? into using hide token

    Posted 09-21-2017 09:35

    This also works for maps. You can create maps in the "background" without map windows flashes in front of the users. Very nice feature. This will make the different modules we make look more professional, because different windows won't open and close all the time while processing.



  • 4.  RE: select? into using hide token

    Employee
    Posted 09-25-2017 08:12

    Create a map in the background, Hans? Can you talk a bit more about how you do this?



  • 5.  RE: select? into using hide token

    Posted 09-25-2017 09:38

    @Peter Horsbøll Møller? You can append the hide keyword the "Map From {table}" command, to create maps in the background by stopping it from opening the new map view right away.

    "Map From {table} hide"

    Almost the same as running

    "Map From {table}

    set window WindowID(0) hide "

    It's just a little bit faster as it does not lock up the mapinfo process to render the map view before running the next command.



  • 6.  RE: select? into using hide token

    Employee
    Posted 09-26-2017 05:07

    Cool! I don't recall ever having used that before!

    Can you actually create the entire map hidden and then for example save it to an image file?

    Or how are you normally using this?



  • 7.  RE: select? into using hide token

    Posted 09-26-2017 05:59

    Yeah it's actually what the WOR file uses to create the map when you open a workspace.

    Hans and I just played around with it a bit, and it seems that it’s possible to anything with the map window that you normally can without the hide keyword.

     

    Example for the situation of creating an entire map (of two layers) and saving a picture of it, without the user ever noticing anything.

     

    Map From BYPOLYGON, VEJMIDTE hide

    Set Map

     Window WindowID(0)

     CoordSys Earth Projection 8, 115, "m", 9, 0, 0.9996, 500000, 0

     Center (556000,6322000)

     Zoom 39494.26415 Units "m"

    Save Window WindowID(0) As "C:\Users\Jonathan\Desktop\Untitled3.BMP" Type "BMP" Width 32.6496 Units "cm" Height 19.5262 Units "cm" Resolution 96

    close Window WindowID(0)

     



  • 8.  RE: select? into using hide token

    Employee
    Posted 09-26-2017 06:21

    That's quite powerful! And the user doesn't have to look at all the flickering while the process is running. Nice!



  • 9.  RE: select? into using hide token

    Employee
    Posted 09-26-2017 11:47

    ?I am not sure why the hide token was not documented. It is supported for most window creation commands including legend designer. Note that in 64 bit Pro the "min" token also equates to "hide".

     

    I will see that it gets documented better.



  • 10.  RE: select? into using hide token

    Posted 10-03-2017 20:35

    Hi Bob,

    You noted that 64bit Pro uses "min" the same as "hide". Is this suggesting that the Hide keyword should work in Pro v15.0 32 bit?

    I just tried Map From [table] Hide and it doesn't work.

    Thanks



  • 11.  RE: select? into using hide token

    Employee
    Posted 10-04-2017 14:49

    ?Hi Simon,  

    Unfortunately no, the hide token and others were introduced to support the new docking manager with the 64bit UI. It will not work in 32bit versions. Since we did not have minimize anymore in the new UI had it do a hide instead which was closest to minimize.



  • 12.  RE: select? into using hide token

    Posted 10-04-2017 18:03

    Thanks Bob, that makes sense.



  • 13.  RE: select? into using hide token

    Posted 10-24-2017 12:42
    Thanks Bob! This is really neat. It really might have been one of my queries! This will be really handy in general. I wonder what other hidden undocumented gems there are like these in MapBasic!