SCOUG-Programming Mailing List Archives
Return to [ 09 |
October |
2005 ]
Content Type: text/plain
On Tue, 4 Oct 2005 21:21:13 PDT7, Steven Levine wrote:
>If you want to post your code, I'll take a look at it.
Thank you, Steven.
I'm thinking that my use of XWorkplace has something to do with this (interfering with the
OREXX-to-WPS class interface). For example, when I use the following code:
TestClass = .WPDesktop
The response that comes back for TestClass is "The XFldDesktop Class". I can then
use the "SUPERCLASS" method on that object, TestClass, to move one class upward
and get back to the WPDesktop class. That is:
Ancestor = SUPERCLASS~TestClass
produces the response "The WPDesktop Class". I have similar problems with other
WPS classes. For example, the code
TestClass = .WPFolder
produces the response "The XFolder Class". Again, I have to use the SUPERCLASS
method to go up three levels to get back to "The WPFolder Class".
Anyway, the code that I'm using, the one that causing my REXX code to stop is as
follows (If you have a chance, please try it out on your system, thanks):
CALL WPCONST.CMD /*Call the WPCONST.CMD REXX script */
SubClass = .WPDesktop
SubClass = .DTTOOLS~CORRECT_CLASS_ID(SSubClass, SubClass, "WPObject")
SAY SubClass
DeskTopArray = .DTTOOLS~GETFOLDEROBJECTS(SubClass)
::CLASS DESKTOP
::CLASS DTTOOLS SUBCLASS DESKTOP
::METHOD CORRECT_CLASS_ID CLASS /*Workaround for
XWorkPlace problem (for some reason an "WP...," classes become "X...,", after using
the "dot" class code instruction??*/
USE ARG Class, StartingClass, Stop
IF TRANSLATE(Class) = "WPDESKTOP" THEN DO
SStartingClass = TRANSLATE(StartingClass, Copies('20'x, 256),
XRANGE('7F'x, '1F'x))
IF TRANSLATE(SStartingClass) = "THE WORKPLACE DESKTOP"
THEN DO
SIGNAL ON NOMETHOD NAME WPDESKTOP_ERROR
SIGNAL ON ANY NAME WPDESKTOP_ERROR
TestClass = .XFldDesktop
TestStartingClass =
.WPSCLASSES~ISOLATE_CLASS(TestClass)
END /*End "IF TRANSLATE(SStartingClass) = "THE WORKPLACE
DESKTOP" THEN DO" Section*/
ELSE DO
TestStartingClass =
.WPSCLASSES~ISOLATE_CLASS(StartingClass)
TestClass = StartingClass
END /*Ends "ELSE DO" Section*/
END /*Ends "IF TRANSLATE(Class) = "WPDESKTOP" THEN DO"
Section*/
ELSE DO
TestStartingClass = .WPSCLASSES~ISOLATE_CLASS(StartingClass)
TestClass = StartingClass
END /*Ends "ELSE DO" Section*/
IF TRANSLATE(TestStartingClass) \= TRANSLATE(Class) THEN DO
SELECT
WHEN TRANSLATE(LEFT(TestStartingClass, 1)) = "X" &
TRANSLATE(LEFT(Class, 1)) = "W" | Class = "WPLaunchPad" | Class = "WPPrinter" |
Class = "WPSystem" THEN DO
DO UNTIL TRANSLATE(TestStartingClass) =
TRANSLATE(Class) | TestStartingClass = Stop
GetSuperClasses =
TestClass~SUPERCLASSES
Index = GetSuperClasses~FIRST
TestClass = GetSuperClasses[Index]
TestStartingClass =
.WPSCLASSES~ISOLATE_CLASS(TestClass)
END /*Ends "DO UNTIL
TRANSLATE(TestStartingClass) = TRANSLATE(Class) | TestStartingClass = Stop"
Section*/
END /*Ends "WHEN
TRANSLATE(LEFT(TestStartingClass, 1)) = "X" & TRANSLATE(LEFT(Class, 1)) = "W"
| Class = "WPLaunchPad" | Class = "WPPrinter" | Class = "WPSystem" THEN DO"
Section*/
WHEN TRANSLATE(LEFT(TestStartingClass, 1)) = "W" &
TRANSLATE(LEFT(Class, 1)) = "X" THEN DO
DO UNTIL TRANSLATE(TestStartingClass) =
TRANSLATE(Class) | TestStartingClass = Ancestor | Index = .NIL
Ancestor =
.WPSCLASSES~ISOLATE_CLASS(TestClass)
GetSubClasses = TestClass~SUBCLASSES
Index = GetSubClasses~FIRST
IF Index \= .NIL THEN DO
TestClass = GetSubClasses[Index]
TestStartingClass =
.WPSCLASSES~ISOLATE_CLASS(TestClass)
END /*Ends "IF Index \= .NIL THEN DO"
Section*/
ELSE TestClass = StartingClass
END /*Ends "DO UNTIL
TRANSLATE(TestStartingClass) = TRANSLATE(Class) | TestStartingClass = Ancestor
| Index = .NIL" Section*/
END /*Ends "WHEN
TRANSLATE(LEFT(TestStartingClass, 1)) = "W" & TRANSLATE(LEFT(Class, 1)) = "X"
THEN DO" Section*/
OTHERWISE NOP
END /*Ends "SELECT" Section*/
END /*Ends "IF TRANSLATE(TestStartingClass) \= TRANSLATE(Class)
THEN DO" Section*/
RETURN TestClass
WPDESKTOP_ERROR:
SIGNAL OFF NOMETHOD
SIGNAL OFF ANY
INTERPRET "TestClass = ."Class
RETURN TestClass
::METHOD GETFOLDEROBJECTS CLASS
EXPOSE wpconst
USE ARG Folder
FolderArray = .ARRAY~NEW
Index = 0
Folder~wpPopulate(0, Folder~wpQueryTitle, .FALSE)
FirstOne = Folder~wpQueryContent(Folder,.wpconst[QC_FIRST])
LastOne = Folder~wpQueryContent(Folder,.wpconst[QC_LAST])
ThisOne = FirstOne /* Start with the first object*/
DO WHILE ThisOne \= .NIL
Index = Index + 1
FolderArray[Index] = ThisOne /* Save object pointer in array*/
SAY "TITLE: "ThisOne~wpQueryTitle
IF ThisOne = LastOne then ThisOne = .NIL /* At end of list? If so,
indicate at end*/
ELSE DO
ThisOne =
Folder~wpQueryContent(ThisOne,.wpconst[QC_NEXT]) /* Otherwise, get the next
folder item */
NOP
END
END
RETURN FolderArray
******************************************************************************************************
Let me interpret the above for you:
1. The "GETFOLDEROBJECTS" method is almost a direct copy of the
code found in the OREXX online reference, REXX.INF ("A Workplace Shell Example:
Displaying Titles). You can also find it on the Internet in "A Simple Object REXX Class
Hierarchy"
2. The above REXX code stops on the line,
SAY "TITLE: "ThisOne~wpQueryTitle
in the "GETFOLDEROBJECTS" method. As I stated before, it just
stops, no error message, nothing.
3. The "CORRECT_CLASS_ID CLASS" method is from me. It corrects the
fault on my system, where I call for a particular WPS class and I get a XWorkplace
class instead (I explained that above).
Thanks for any help or insight on this. I would be interested to know if you experience
any of the above problems
HCM
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"postmaster@scoug.com".
=====================================================
Return to [ 09 |
October |
2005 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the 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.
|