home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / dispatch / readme.txt < prev   
Text File  |  1993-09-03  |  2KB  |  62 lines

  1.  
  2. This is the first attempt of a little dispatcher to invoke 'local' procedures of a 
  3. form from other modules/forms.
  4.  
  5. All procedures defined in a form are local to that form. So there's no chance to
  6. load a form, invoke one or more procedures of the form and then to show it.
  7.  
  8. My problem was:
  9.  
  10.     I build a form with data access to show the user some data to choose from.
  11.     The data shown in the form is dependent on other data stored somewhere in
  12.     other forms. I wanted to change the data recordsource and some other controls
  13.     while loading the form.
  14.     One way to do this is to set the controls via form1!control...
  15.     But then I have the same code on several places in my application.
  16.     Calling (the way I prefer) a form procedure doesn't work because all procedures
  17.     of a form are local to that form.
  18.  
  19. So I implemented my litte dispatcher.
  20.  
  21. The dispatcher is a textbox control array on the form I want to invoke procedures from.
  22. The procedures are invoked in the change-event procedure of the textbox.
  23.  
  24. The name of the textbox array is 'dispatcher'
  25.  
  26. dispatcher(1) - dispatcher(n) must be set with the arguments of the procedure to call.
  27. dispatcher(0) must be set with the name of the procedure as string.
  28.  
  29. Setting these values will cause a change-event in the dispatcher control. 
  30.  
  31.  
  32. But better you have a look at the forms and the code I included into the ZIP file.
  33.  
  34. The ZIP file includes:
  35.  
  36.     form1.frm        The form invoking procedures of form2    
  37.     form2.frm        The form which procedures are invoked
  38.     dispatch.bas        Dispatcher source code
  39.     project1.mak        The VB 3.0 Project
  40.     readme.txt        This file
  41.  
  42.  
  43. Maybe there's another (better) way to solve this task.
  44. All comments are welcome and appreciated.
  45.  
  46. I can be reached at:
  47.  
  48.     Oliver Mangold
  49.     Hagsbucherweg 20
  50.     89150 Laichingen
  51.     Germany
  52.  
  53.     Tel. 49-7333-6007  Fax. 49-7333-21266
  54.  
  55.     Or E-Mail at CompuServe 100277,511
  56.  
  57.  
  58.  
  59. Excuse me for my bad English. It isn't as good as it could be :-) 
  60.  
  61. Oliver    
  62.