home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,976 of 2,978   
   Marco van de Voort to Dr John Stockton   
   Re: How to iterate through 80-100 proced   
   26 Dec 05 16:39:20   
   
   From: marcov@stack.nl   
      
   On 2005-12-21, Dr John Stockton  wrote:   
   >>hoping that I don't forget something in a long init section, etc.?   
   >   
   > I think you mean "... all tests consecutively."   
   >   
   > Having defined all routines individually, can you not declare a constant   
   > array of routine with contents being the list of routines?  I do a   
   > superset of that, IIRC, in my program longcalc.pas, on my site in   
   > programs/ , in   
      
   Another classic way is having all tests "register" themselves. This keeps   
   you from maintaining a list of tests.   
      
   So e.g. have a test per unit, and in the initialisation of the unit register   
   the procedure to test and various other parameters to some central unit   
   testing registry. (and array/list whatever)   
      
   The actually testing will the walk that list. The advantage is that if you   
   remove units, the tests are also not registered anymore, and the same for   
   adding tests/units.   
      
   So   
      
    RegisterOpnode('Nop',@fnop,t,'',@_nop,'nop');   
      
      
   The procedure registeropnode (or registertest) then adds it to a growing   
   list.   
      
   A possible problem of this method is that the running of the test will   
   follow unit initialisation.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca