Using MapBasic V3. I'm trying to create a number of polyline objects and save them in a table. I'm getting a compiler error relating (I think) to the insert statement. I am trying to modify an mbx which I have used successfully many times, which basically opens a workspace, gets user input, goes to the desired map area, creates a polyline object which overlays the map area, prints the map, then goes to the next selected area and repeats the procedure, until done. I just overwrite the polyline object each time as it's not necessary to save it in it's new location. Now I would like to create a table of these polyline objects. Apparently instead of the update command I have to use the insert command, and then commit the table; but not having built anything with MapBasic except this mbx I don't really understand what I'm doing wrong, nor do I have the time to trial and error it. Here is the relevant code for building the polyline object; can someone tell me how to make the insert statement compile? Please ignore the references to printing. I just want to create a table of these objects.
'******************************************************** '***Main business program '***Declare local variables sub doit dim xcoord as float dim ycoord as float dim win_id as integer win_id = FrontWindow() dim node1x as float dim node1y as float dim node2x as float dim node2y as float dim node3x as float dim node3y as float dim node4x as float dim node4y as float dim newsub as object '*** copy all the records, from the first grid number '*** entered by the user, to the last grid number '*** entered, to a temporary file called selection select * from sdgo_grid_zone6 where Name>=s_startgrid And Name<=s_endgrid into Selection '***Go to the first record in the selection table '***Copy the centroid xy coordinates to variables '***Center the map window on the new coordinates '***Go to the next record in the file, '***And repeat the process, '***Until the grid number entered as '***Ending grid is processed fetch first from selection Do while not EOT(selection) Set Map CoordSys Earth Projection 1, 0 ycoord=CentroidY(selection.obj) xcoord=CentroidX(selection.obj) Set Map Window win_id Center (xcoord,ycoord) '*** get the 4 corner nodes' xy values from the grid object node1x=objectnodex(selection.obj, 1,1) node1y=objectnodey(selection.obj, 1,1) node2x=objectnodex(selection.obj, 1,2) node2y=objectnodey(selection.obj, 1,2) node3x=objectnodex(selection.obj, 1,3) node3y=objectnodey(selection.obj, 1,3) node4x=objectnodex(selection.obj, 1,4) node4y=objectnodey(selection.obj, 1,4) '*** create new polyline object for 20 subgrids, stored in a variable, from '*** node values taken from grid object (selection) '*** inner node values are obtained by '*** adding or subtracting from upper left '*** node values on grid object '*** the polyline object (subgrid divider) '*** has 15 nodes, which are built in node number order create pline into variable newsub 15 ((node4x +.004334),node4y) ((node4x +.004334),(node4y-.014516)) ((node4x +.008694),(node4y-.014470)) ((node4x +.008694),(node4y+.000045)) ((node4x +.013054),(node4y+.000065)) ((node4x +.013054),(node4y-.014410)) ((node4x +.017393),(node4y-.014410)) ((node4x +.017383),(node4y-.011570)) ((node4x +.000035),(node4y-.011590)) ((node4x +.000035),(node4y-.008740)) ((node4x +.017370),(node4y-.008680)) ((node4x +.017413),(node4y-.005800)) ((node4x -.000013),(node4y-.005840)) ((node4x +.000005),(node4y-.002914)) ((node4x +.017413),(node4y-.002854)) '*** set the appearance of the polyline Pen MakePen(2,2,black) '*** replace the original subgrid object '*** with the contents of the variable '*** containing the newly built subgrid object 'update subgrid20 'set obj=newsub insert into subgrid20 ERROR LOG SAYS "FOUND [COMMIT] while searching for [select] commit table subgrid20 I don't understand what it's trying to tell me. '*** print the map window, reset the value '*** of iend, get the next grid record. '*** when all requested maps are printed, '*** bring up a dialog (dbox2) asking the user '*** if he wants to print more maps or quit Set Map CoordSys Earth Projection 3, 33, "survey ft", -116.25, 32.1666666667, 32.7833333333, 33.8833333333, 6561666.6670000004, 1640416.6669999999 Fetch Next from selection loop Call dbox2 end sub --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 5149