Subject: [os2genau_digest] No. 1835
From: Digest <deadmail>
To: "OS/2GenAu Digest"<deadmail>
Date: Sun, 12 Jul 2009 00:00:30 EST-10EDT,10,1,0,7200,4,1,0,7200,3600

**************************************************
Saturday 11 July 2009
 Number  1835
**************************************************

Subjects for today
 
1  Re:  What a difference a clean install makes ! : bokeny at earthlink dot net
2  Re:  What a difference a clean install makes ! : John Angelico" <talldad at kepl dot com dot au>

**= Email   1 ==========================**

Date:  Fri, 10 Jul 2009 12:54:21 -0400
From:  bokeny at earthlink dot net
Subject:  Re:  What a difference a clean install makes !

In <001.a85b010024ee554a.009 at kepl dot com dot au>, on 07/09/2009 
   at 11:18 PM, "John Angelico" <talldad at kepl dot com dot au> said:

>On Thu, 09 Jul 2009 07:12:59 +1000 Ed Durrant wrote:
>>
>>
>>
>>So I wiped an already installed eCS 2.0 RC6a partition and started 
>>fresh. It's taken sometime manually writing down the properties of my 
>>main wps objects from the eCS 2.0RC3 partition and then re-creating them 
>>on the RC6a partition 

>Argh! 

>Ed, if you had said that was what you had to do, I could have offered a
>labour-saving device from my boys here.

>They have created a small tool in Rexx using the WP Tools APIs to save
>object properties in a Rexx script, and then recreate objects by
>replaying the script.

Hello John,
Do you care to share it with the public?  The finalized eCS 2.0 is
comming soon, so probably many people would be interested in your
utility.

--
Zoltan Bokeny 
bokeny at earthlink dot net
Fayetteville, North Carolina

I will not shop at "Wal-Mart Stores, Inc. of China"!

--------------------------------------------------
 
 http://www./melbpc/  -  The Melbourne OS/2 SIG
===
**= Email   2 ==========================**

Date:  Sat, 11 Jul 2009 15:08:47 +1000 (AEST)
From:  "John Angelico" <talldad at kepl dot com dot au>
Subject:  Re:  What a difference a clean install makes !

On Fri, 10 Jul 2009 12:54:21 -0400 bokeny at earthlink dot net wrote:
>
>
>
>>They have created a small tool in Rexx using the WP Tools APIs to save
>>object properties in a Rexx script, and then recreate objects by
>>replaying the script.
>
>Hello John,
>Do you care to share it with the public?  The finalized eCS 2.0 is
>comming soon, so probably many people would be interested in your
>utility.

Hi Zoltan and all.

The boys say fine so here it is as text:
[Begins---------------------------------------]
/* */
OUTPUTDIR="~HOME" /* Valid options: ~HOME for original directory, ~CURDIR
for current directory of final program, or literal directory name */
SUBDIRS=1 /* Recurse into subdirectories */
PARSE ARG DIR "INDIV="INDIVIDUAL /* If 1, individual files made; if 0, one
file */
IF INDIVIDUAL="" THEN INDIVIDUAL=0
IF (DIR="")|(DIR=DIRECTORY()) THEN SIGNAL GO
IF ABBREV(DIR,"WP_") THEN DO; STEM.0=1; STEM.1="<"DIR">"; CALL SAVE_IT;
EXIT; END
OLD=DIRECTORY()
CALL DIRECTORY DIR
NEW=DIRECTORY()
IF NEW=OLD THEN CALL DIRECTORY
DBRRIGHT(FILESPEC("D",DIR)FILESPEC("P",DIR),1)
GO:
CALL WPTOOLSFOLDERCONTENT DIRECTORY(),"STEM"
F="POB_ALL.CMD"
IF (\INDIVIDUAL&(STREAM(F,"C","QUERY EXISTS")="")&(STEM.0>0))|SUBDIRS THEN
DO
	CALL LINEOUT F,"/*-PSaver Multiple Save File-*/"
	CALL LINEOUT F,'CALL RXFUNCADD
"SYSCREATEOBJECT","REXXUTIL","SYSCREATEOBJECT"' /* Load reqd function from
REXXUTIL.DLL */
	CALL LINEOUT F,"/* "DIRECTORY()" */"
END
CALL SAVE_IT /* says Jim! */
IF SUBDIRS=1 THEN DO /* Go through subdirectories too (note that the PSave
file will be in the parent) */
	CALL SYSFILETREE STRIP(DIRECTORY(),"T","\")"\*.*","DIRS","DOS"
	DO DD=1 TO DIRS.0
		CALL WPTOOLSFOLDERCONTENT DIRS.DD,"STEM"
		IF STEM.0=0 THEN ITERATE
		IF \INDIVIDUAL THEN CALL LINEOUT F,"/* "DIRS.DD" */"
		SAY DIRS.DD
		CALL SAVE_IT
	END
END
EXIT

SAVE_IT:
DO I=1 TO STEM.0
	CALL WPTOOLSQUERYOBJECT STEM.I,"C","T","S","L"
	IF \RESULT THEN DO; SAY STEM.I" --> cannot QueryObject"; ITERATE;
END
	SAY C"	"T
	IF INDIVIDUAL THEN DO
		VAR="POB_"
		TMP=TRANSLATE(T)
		DO WHILE
VERIFY(TMP,XRANGE("A","Z")"!?_"XRANGE("0","9"))>0
			VAR=VAR||LEFT(TMP,VERIFY(TMP,XRANGE("A","Z")"!?_"XRA
NGE("0","9"))-1)
			TMP=DBRLEFT(TMP,VERIFY(TMP,XRANGE("A","Z")"!?_"XRANG
E("0","9")))
		END
		F=VAR||TMP".CMD"
	END
	S=DBLAPOS(S)
	SS=""
	DO WHILE LENGTH(S)>200
		SS=SS||LEFT(S,200)"'||'"
		S=DBRLEFT(S,200)
	END
	S=SS||S
	SELECT
		WHEN OUTPUTDIR="~HOME" THEN L="'"L"'"
		WHEN OUTPUTDIR="~CURDIR" THEN L="DIRECTORY()"
	OTHERWISE L="'"OUTPUTDIR"'"
	END
	IF (C="WPShadow")|(C="SCShadow") THEN T="__SHADOW__RECREATING__" /*
Creating shadow; see below. */
	IF INDIVIDUAL THEN DO
		CALL LINEOUT F,"/*-PSaver Individual Save File-*/" /* Make
OS/2 see that it's REXX not batch */
		CALL LINEOUT F,'CALL RXFUNCADD
"SYSCREATEOBJECT","REXXUTIL","SYSCREATEOBJECT"' /* Load reqd function from
REXXUTIL.DLL */
	END
	CALL LINEOUT F,"CALL SYSCREATEOBJECT
'"DBLAPOS(C)"','"DBLAPOS(T)"',"DBLAPOS(L)",'"S"','U'" /* Create it! */
	IF INDIVIDUAL THEN CALL LINEOUT F
END
RETURN
/*
When recreating a shadow, a name must be selected which does not conflict
with an existing file.
However the new object will not keep that name. Therefore the name
__SHADOW__RECREATING__ appears to me to be reasonable. If you suspect that
you may have an object of that name, feel free to change the temporary
name.
*/

DBLAPOS: PROCEDURE
PARSE ARG IN
OUT=""
DO WHILE POS("'",IN)>0
	PARSE VALUE IN WITH CUR"'"IN
	OUT=OUT||CUR"''"
END
RETURN OUT||IN

[Ends---------------------------------------] 

It uses WP Tools APIs so you need WP Tools as a prerequisite.

Enjoy!

Best regards
John Angelico
OS/2 SIG
os2 at melbpc dot org dot au or 
talldad at kepl dot com dot au
___________________
--------------------------------------------------
 
 http://www./melbpc/  -  The Melbourne OS/2 SIG