|
Next Meeting: Sat, TBD
Meeting Directions
|
Navigation:
20 Most Recent Documents
Search Archives
Index by date,
title,
author,
category.
|
|
Features:
Mr. Know-It-All
Ink
Download!
|
|
|
|
|
|
|
SCOUG:
Home
Email Lists
SIGs (Internet, General Interest, Programming, Network, more..)
Online Chats
Business
Past Presentations
Credits
Submissions
Contact SCOUG
Copyright SCOUG
|
|
Pictures from Sept. 1999
|
|
The views expressed in articles on this site are those of their authors.
|
SCOUG was there!
|
|
Copyright 1998-2024, Southern California OS/2 User Group.
ALL RIGHTS RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the
Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of
International Business Machines Corporation.
All other trademarks remain the property of their respective owners.
The Southern California OS/2 User Group
USA
|
|
|
SCOUG OS/2 For You - April 1998
Referencing REXX Functions
thanks to Terry Warren
The following question came up at a recent Programming SIG meeting. Can multiple functions/subroutines be defined in one REXX Command file and then directly referenced from another?
Using the latest level of REXX (i.e., Object REXX), this is quite easy to do:
- Create the file which contains the functions or subroutines and simply define each as a public routine. For example, edit sub1.cmd to contain:
/* Rexx program defining two subroutines */
::ROUTINE sub1Func1 PUBLIC
RETURN 'value from Func1 in sub1.cmd'
::ROUTINE sub1Func2 PUBLIC
USE ARG inputArg
Say 'Func2 in sub1.cmd received the value ' inputArg
- In any other REXX command file, reference these functions as needed, such as:
val1 = sub1Func1()
or
Call sub1Func2 'this arg was passed'
- Then, at the end of this command file, insert the directive:
::REQUIRES sub1
This last action tells the compiler and runtime to look in sub1.cmd for routine definitions if they are not resolved in the current cmd file. You can code multiple REQUIRES directives; their order determines the order in which names are resolved.
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 1998 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG is a trademark of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
/
|
|