Hello All!

I require some input from all who can assist with building menus on the
fly.  I'm new to MB and MI so I'm still trying to learn it!  Here is
what I'm trying to do and the problems I'm running in to.

I have a table which is storing views which have been entered in by a
user(Table Structure:  TableIndex, ViewName, Lat, Lon, Zoom).  When the
workspace loads I want the menu Views to appear as a Sub Menu under
AVL--(I got this part).  Next I want the Sub (below) to loop through the
table and pull the ViewName(s) from the table and list them under the
Views Sub-menu (so when i go to Views all the named Views from the table
will pop out to the right).

Right now all I am getting is the last ViewName in the table appearing,
but not the others (I think I'm missing something inside my loop or the
structure is wrong and I can't see it).  If I put arrMenu in instead of
v_name in the ...

Create Menu "&Views" As
 v_name

...part i get these errors:
"Subscript out of range" or " Cannot use an arrray user defined type in
expression."

Any ideas?

I also have another thought/problem which I haven't tried to do yet, but
if anyone has any thoughts they would like to pass along please do.  If
and when I get this menu to work I will need to query the table to
extract the Lon, Lat and Zoom of the user's selection from the menu item
and zoom the map to these coordinates.  I know I will need to pass the
variables into something like:   Set Map Window MAIN_map_winid
Center(lon,lat) Zoom zoom -----but how do you think I should attack
this?

Thanks in advance to all who gave it any thought.  I hope I can
contribute to the message board to help other MI and MB down the road!

Do you think using a dialog box or a pop up would be easier than using
the menu list to do this problem?

Scott Walsh
State College, Pa

'***************************************************************************************************************

SUB AVLVEH_update_menu

DIM ii as INTEGER
DIM v_index AS INTEGER
DIM v_name AS STRING
DIM v_lat AS FLOAT
DIM v_lon AS FLOAT
DIM v_zoom AS FLOAT

'opening the table---declared at top
OPEN TABLE v_table

'Looping throught pulling out the values in the table
FETCH First FROM NewView
 ii=1
DO WHILE NOT EOT(NEWVIEW)
  REDIM arrMenu(ii)
   arrMenu(ii) = NewView.viewname
      v_name = arrMenu(ii)              '---Will return the last
viewname in the table, but not any other names.
  FETCH Next FROM NewView
  ii = ii + 1
Loop

Create Menu "&Views" As
 v_name

Create Menu "A&VL" As
  "&Views" AS "Views", 'Adding the view name into the menu bar
  "(-",
  "&Add Quadrant/WA" Calling AVLVEH_quadrant_add_dialog,
  "&Delete Quadrant/WD" Calling AVLVEH_quadrant_delete_dialog,
  "(-",
  "&Find Unit.../WF" Calling AVLVEH_vehicle_find_dialog,
  "(-",
  "&Update Now/Wu" Calling AVLVEH_update_locations_now

Alter Menu Bar Add "AVL"
'Alter Menu Bar Add "Views"

Create Menu "&Close" As "&Close" Calling MAIN_exit  'Calling the
Main_exit sub from the DispMap_main.mb
  Alter Menu Bar Add "Close"      'to close down MapInfo


PRINT "Data from Menu - ADD : "  & v_name


END SUB
'**********************************************END************************************************************



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to