Wiki Home

Scc Text


Namespace: WIN_COM_API
SCCTEXT.PRG converts Visual FoxPro power tools tables (SCX, VCX, MNX, FRX, but NOT PJX) into text-equivalents. The original was written in 1995 by Sherri Kennamer and has had only minor changes to it. The program is well-commented and has some very interesting code in it. For example, the program was originally intended to be used as a two-way tool; not only could it create text files from tables, but it could create tables from text files! Comments seem to indicate that this was intended for merging of different versions, but the features were never exposed in the product and, in fact, a series of constants need to be changed in order to have the functionality work at all.

There are some flaws in the design.

One of the flaws is that SCCTEXT generates code from memo fields in the order they appear in the memo. Form and class designers re-arrange the methods so that the most recently edited begins the memo. Attempting to determine the difference on a Methods memo therefore leads to huge differences caused only by the positions of the different methods within the memo field. Mark Wilden wrote a work-around for this in FoxPro Advisor some time ago.

SCCTEXT is a program begging for a good refactoring. Changes I would like to see include:
First post. Comments welcomed. -- Ted Roche

A lot of enhancements have been made by various contributors and got accumulated in the ProLib-supplied version. (Download that revised version from the ProLib archives: ftp://ftp.prolib.de/public/vfp/pl_scctext.prg) Changes are documented in the header.
New: That ProLib-version was moved to Codeplex and renamed to Scc Text X. See vfpx.codeplex.com for the most current version -- ?wOOdy

The SCCTEXT.PRG in VFP 8.0 has the methods sorted in alphabetical order.

Hint: The VFP 8.0 version of SCCTEXT.PRG can be used in VFP 6.0 (and 7.0 presumably), by changing the "Text Generation" program in the Projects tab of the Tools | Options dialog.

-- Tom

Yes, Microsoft contacted me at some point to ask if they could incorporate my method-sorting in the released version of SCCTEXT.PRG.

-- ///ark

10/25/2007

Here's a nifty way to prompt for user input for what it's worth....
Right below the "* Used by the thermometer" area....comment out the PARAMETERS statement
and add from "private" on down to the "and the rest" comment.

* Used by the thermometer
#DEFINE WIN32FONT				"MS Sans Serif"
#DEFINE WIN95FONT				"Arial"

*---------------------------------------------------------------------------
*PARAMETERS cTableName, cType, cTextName, lGenText

private LcTableName, LcType, LcTextName, LlGenText

LcTableName = SPACE(50)
LcType = SPACE(2)
LcTextName = SPACE(50)
LlGenText = SPACE(2)

DEFINE WINDOW UI FROM 1,1 TO 25,60 TITLE "Get User Input" close float
ACTI WINDOW UI
nrow = 0
ncol = 1


nrow = nrow+1
@ nrow,ncol say "Fully-qualified name of the SCX/VCX/MNX/FRX/LBX"
nrow = nrow+1
@ nrow,ncol get LcTableName

nrow = nrow+1
nrow = nrow+1
@ nrow,ncol say "Code indicating the file type"
nrow = nrow+1
@ nrow,ncol get LcType

nrow = nrow+1
nrow = nrow+1
@ nrow,ncol say "Fully-qualified name of the text file"
nrow = nrow+1
@ nrow,ncol get LcTextName

nrow = nrow+1
nrow = nrow+1
@ nrow,ncol say "GenText (Y = TEXT FROM TABLE)"
nrow = nrow+1
@ nrow,ncol say "        (N = TABLE FROM TEXT)"
nrow = nrow+1
@ nrow,ncol get LlGenText

SHOW WINDOW UI

READ

CLEAR READ

* PROCESS USER INPUT
cTableName = ALLT(LCTABLENAME)
cType = ALLT(LCTYPE)
cTextName = ALLT(LCTEXTNAME)
lGenText = IIF(ALLT(LLGENTEXT)=="Y",.T.,.F.)

nrow = nrow+1
nrow = nrow+1
@ nrow,ncol say "PROCESSING STARTED AT: "+TRANSFORM(DATETIME())



...and the rest of the program is here.

and then after the MACHINE and OFF if statements you can put the 3 lines just before the RETURN (m.iresult)


IF NOT m.cCollate == "MACHINE"
	* set back changed collate setting to user's choice
	SET COLLATE TO (m.cCollate)
ENDIF
IF NOT m.cCompatible == "OFF"
	* set back changed compatible setting to user's choice
	SET COMPATIBLE &cCompatible.
ENDIF

nrow = nrow+1
nrow = nrow+1
@ nrow,ncol say "PROCESSING COMPLETE  : "+TRANSFORM(DATETIME())

RETURN (m.iResult)


No, it's not the most elegant solution but...
Comments??
Hi just add following Code to your Memowrite-Method. Otherwise SCC-Text recognizes unimportant change
( Topic last updated: 2011.11.17 10:56:17 PM )