Original Message:
Sent: 08-25-2023 15:47
From: Bryan Kubishta
Subject: Mapbasic Find succeeds with popup error
Hi Peter, thank you so much for the response! Changing the trackId column to a string seems to have changed the problem. The same error message popup is randomly seen, and seen every time if reportErrorsToMapBasic is true. But the difference is this time I caught it also happening sometimes when we run the "Find Using TRG_HST_1(trackId)" command.
So right now the relevant MapBasic calls are these:
Create Table TRG_HST_1 (trackId Char(10) ,REPCODE Integer ) File "C:\temp\MItables\TRG_HST_1"
Create Map For TRG_HST_1
Create Index On TRG_HST_1(trackId)
Commit Table TRG_HST_1
Add Map Window 3000 Auto Layer TRG_HST_1
Set Map Window 3000 Layer "TRG_HST_1" Editable Off Selectable On Zoom (1,100000) Off Label Position Center Font("Arial",0,12,16776960) Pen(1,2,0) With Str$(trackId) Parallel On Visibility Off Auto Off Overlap Off Duplicates Off Offset 3 Display Graphic
//example insertion
Set Table TRG_HST_1 REDRAW OFF
Dim TargetHistory As Object
Create Pline Into Variable TargetHistory 5 (-56.89900, 38.64200) (-56.82300, 38.65000) (-56.74600, 38.65600) (-56.66700, 38.65900) (-56.65500, 38.64400) Pen(2,2,16776960)
Insert Into TRG_HST_1 (trackId,REPCODE,Object ) Values ( "15708",2,TargetHistory )
//example find
Find Using TRG_HST_1(trackId)
Find "15708"
Set Table TRG_HST_1 REDRAW ON
Are the error popups somehow queued when reportErrorsToMapBasic is false, and then shown when it's true? I'm manually controlling it and at least once even saw the same error shown when executing the Insert command, and the Dim command, above. There's a lot more happening than the above after table creation. We are potentially executing hundreds of commands per second so the popups happening now might not be coming from where we think?
------------------------------
Bryan Kubishta
Raytheon Co
CHESAPEAKE VA
------------------------------
Original Message:
Sent: 08-23-2023 02:12
From: Peter Møller
Subject: Mapbasic Find succeeds with popup error
Hi Bryan
The Find command is built to search for addresses and I think it expects string values.
From the syntax of the statement, you can also see that it expects a string expression for the address value.
Find address [ , region ] [ Interactive ]
address is a string expression representing the name of a map object to find; to find the intersection of two streets, use the syntax: streetname && streetname.
region is the name of a region object which refines the search.
Would it be possible to use a Char column for the value you are searching for instead of an Integer column?
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data