Hello All!

I'm new to MB and MI and am having difficulty trying to do something and
need help!  I've created a dialog box which loops through a table and
displays the name of the View(s) that are in the table to the user in a
list box.  The table structure is as follows:

Table Name:  NewView
Fields:  TableIndex, ViewName Char(30), Lan Float, Lon Float, Zoom
Float....so i'm getting the Lon and lat and zoom of the current map and
storing it in the Table...when the user adds a view...anyway....

Below I'm attempting to display the names..which seems to be
working...then when a user clicks on a name in the listbox I'm trying to
get the ReadControlValue of the control (listbox) and compare it to what
is in the Table to REMOVE that Row from the table...so the next time the
user brings up the dialog the name they deleted should not be
there...does this make sense?

Thanks everyone!
Scott



SUB AVLVEH_quadrant_delete_dialog

DIM prompt AS LOGICAL
DIM v_name AS STRING
DIM ii AS INTEGER                   'counter
DIM l_value as INTEGER

OPEN TABLE v_table  'opening the table   Path is declared at top...

FETCH First FROM NewView                        'Looping throught
pulling out the values in the table   NewView is the table name
ii=1
DO WHILE NOT EOT(NEWVIEW)
  REDIM arrMenu(ii)
       arrMenu(ii) = NewView.viewname
  FETCH Next FROM NewView
 ii = ii + 1
Loop

Dialog
     TITLE "Delete Quadrant"
     WIDTH 112
     HEIGHT 160
 CONTROL ListBox
      WIDTH 100
      HEIGHT 100
      ID 100
      TITLE FROM VARIABLE arrMenu
 CONTROL OKButton
      TITLE "&Delete View"
      POSITION 30,120
      ID 101
      CALLING okhandler
'------------------------------------------------------
 CONTROL CancelButton
      TITLE "&Exit"
      POSITION 36,140
      ID 103
 IF COMMANDINFO(CMD_INFO_DLG_OK) THEN
  'prompt=ASK("Quadrant is about to be deleted from the AVL menu
list.","&OK","&Cancel")  'Commented out for now...but am having trouble
getting to work
   'IF prompt = FALSE
THEN
'b/c the dialog needs to be open in order to get the
    'CALL
AVLVEH_quadrant_delete_dialog
'ReadControlValue
   'ELSE
    'CALL okhandler
   'END IF
 END IF

END SUB
'----------------------------------------------I'm not sure about this
SUB...
'---------I want to take the id of the user selection from the dialog
list box..loop through the table and delete the row.....i'm confused...

SUB okhandler

DIM c_id AS INTEGER
DIM ii AS INTEGER

c_id = ReadControlValue(100)  'Gets the value of the item selected (1
for the first, 0 if none selected)


Open TABLE v_table
DELETE OBJECT FROM NewView WHERE TableIndex = c_id  '----doesn't seem to
work?????
COMMIT TABLE NewView

END SUB




_______________________________________________________________________
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