ObjRexx Resource Control usage 
Author Message
 ObjRexx Resource Control usage


--I'm working with my first ObjRexx application using the Resouce Workshop and
--oo-dialog (not my first Rexx app, just the first with a GUI interface) and am
--still having a fairly fundamental problem populating list-boxes, combo-boxes
--etc.  In all of the example code I've seen, list- and combo-boxes are filled
--with data that is hard-coded in the INIT method.  In real life, this data
--would not be known until run-time and I can't figure out how to get it
--visible to the INIT method.  For instance, I want to fill a combo-box with a
--list of available drive letters.  I get a string of the available drives with
--the SysDriveMap function, then parse them into a stem variable or an array
--object.  But then I can't get the INIT method of the dialog object to see
--this array.  If I create and load the array within the INIT method it works
--fine  there, but then it (the array) is not available *outside* of the
--method.  In another example, I have a hard-coded list of available servers
--that I want to list on a dialog panel, but I also need to loop through the
--list in some other processing, so don't want to have to maintain two lists -
--one inside the INIT method and one outside.

If you want the array to be visible in different parts of your program, then
you may want to use Object Rexx' environment (".environment" or ".local") to
share that array, e.g.

   ... someplace in your code ;) ...

               /* create an array and fill it with data */
   tmpArray = .array ~ of( "one", "little", "two", "little", "..." )
               /* put the array into the environment    */
   .local ~ myPersonalArray = tmpArray

   ... someplace else in your code, maybe in an INIT-mehtod you can access that
       array via its environment name (i.e. a name starting with a point) ...

   say .myPersonalArray ~ items   /* would yield 5 in this case */

you could assign this array to a local variable instead, like:

   tmpArray = .myPersonalArray    /* still using an environmental symbol */


   tmpArray = .local ~ myPersonalArray  /* ask the .local-directory for the entry
                                           MYPERSONALARRAY, which returns the array */

Maybe it could be helpful to read about Object Rexx' scopes in order to
understand why by default a locally defined array is not visible outside the
scope of a routine or a method, like the "local.ps" in "orx7doc.zip" on
hobbes.nmsu.edu or ftp.cdrom.com, placed in the rexx or orexx subdirectories.


Wed, 07 Feb 2001 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Clipper, Win95 resource usage

2. Intel Fortran 8.0 resource usage during compilation

3. System Resources/Memory Usage Tracker???

4. Resource usage

5. tk resource usage?

6. Usage of Cosmo ActiveX Control, how ?

7. Set Control Value returns error 15 ( Resource not found) after Application Building

8. picture control uses up all the resources

9. visa resource name control and application builder

10. Controlled types for resource locking

11. Resource control within the programming language

12. Resource Fork has no Resource Fork?


Powered by phpBB® Forum Software