SPRTOSCX 2.0



INTRODUCTION


SPRTOSCX.PRG is a utility that updates an .SCX database from a 
modified .SPR or .PRG file that was automatically generated using 
GENSCRN.  Only the WHEN, VALID, ERROR, MESSAGE, ACTIVATE, 
and DEACTIVATE expression or procedure GET and READ clause 
snippets are updated in the .SCX database.  Any other changes made to 
the .SPR file are ignored.  Snippets previously empty cannot be added to 
the .SPR file, only changes of existing snippets are updated.  Snippets 
that contain #INSERT (GENSCRN) or #:INSERT (GENSCRNX) are 
ignored and cannot be updated.  Snippets with #NAME can be updated 
but the function name cannot be changed in the .SPR.  If changes are 
made to an .SPR that have cross-platform code (more than one 
platform), then SPRTOSCX will only updated changes made to the 
current platform.  If changes are detected in the any current platform 
snippets, then the other platform snippets are automatically updated for 
that object if where previously identical.  If the other platform snippets are 
different before the changes are made the .SPR file, then SPRTOSCX 
will not update the snippet for those objects.  SPRTOSCX cannot be 
used with .SPR files that were generated from a screen set of more than 
one screen.  Although SPRTOSCX uses .SPR and .SCX extensions by 
default, any file extensions can be used when passing file names using 
the direct method described below.  Both the .SPR file and .SCX 
database must be in the current directory or in the current FoxPro PATH 
unless SPRTOSCX.PRG is executed directly by passing the full path 
names of the both the .SPR file and the .SCX database.




USING SPRTOSCX WITH GENSCRNX PREPROCESSED SCREENS


If GENSCRNX was used as a GENSCRN preprocessor when the .SPR 
file was generated then the following is checked.  If the *:BASLIB 
directive is used in the Setup snippet then all changes are ignored.  Also, 
if any object's Comment snippet contains either the *:BASOBJ directive 
or {{<expC>}} for evaluation, then that object's snippet changes are 
ignored.  SPRTOSCX was not designed to be used with screens that use 
GENSCRNX drivers so that driver generated snippets can be mapped 
back to the .SCX database.  Although this may sometimes work, it is not 
recommended.  SPRTOSCX should be used as a tool to help develop 
and test snippets for screens that do not have snippets automatically 
generated from either GENSCRNX drivers or from a GENSCRNX 
generated FOXSCX library.  SPRTOSCX may be useful in prototyping 
and testing snippet procedures and expressions being created to 
eventually be used for GENSCRNX drivers and/or libraries.




INSTALLATION


After unzipping SPRTOSCX.ZIP, copy SPRTOSCX.PRG to any 
directory.  It is recommend that SPRTOSCX.PRG is in a directory of 
FoxPro's PATH during development.  If SPRTOSCX.PRG is not in 
FoxPro's PATH, then SPRTOSCX must be called directly each time 
specifying the directory.




HOT KEY EXECUTION


SPRTOSCX.PRG can be set to be executed for the open .SPR window 
by creating hot keys using the ON KEY LABEL command.  When any 
.SPR file is opened either automatically or manually using the MODIFY 
FILE command, then SPRTOSCX.PRG can be set to automatically 
update the related .SCX database for the open .SPR file.

Example:
ON KEY LABEL F8 DO SPRTOSCX
If a .SPR file window is open and the F8 key is pressed, then 
SPRTOSCX is executed for the currently open .SPR file.

Example:
ON KEY LABEL F9 DO SPRTOSCX WITH .T.
If a .SPR file window is open and the F9 key is pressed, then 
SPRTOSCX is executed for the currently open .SPR file.  If one or more 
snippets are updated, the screen builder will automatically be opened and 
re-generate the .SPR file.  If AutoGenerate parameter is .T., the .SCX 
was preprocessed by GENSCRNX, and the scree was built from within a 
project, then the project will be reopened and built if any changes occur.

Important:
If the open .SPR file is not in either the current directory or FoxPro's path 
then DO SPRTOSCX will report that the .SPR file is not found.

Note:
The above example hot keys F8 and F9 could be substituted for any 
other unused hot key setting.




DIRECT EXECUTION


SPRTOSCX.PRG can be directory executed by calling SPRTOSCX as a 
function or a procedure and passing the screen name and optional auto-
generate screen flag.

Example:
=SPRTOSCX('MYSCREEN')
  or
DO SPRTOSCX WITH 'MYSCREEN'
Update MYSCREEN.SCX from changes made to MYSCREEN.SPR.  The 
number of snippets updated is returned.

Example:
=SPRTOSCX('MYSCREEN',.T.)
  or
DO SPRTOSCX WITH 'MYSCREEN',.T.
Update MYSCREEN.SCX from changes made to MYSCREEN.SPR.  The 
number of snippets updated is returned.  If one or more snippets are 
updated, the screen builder will automatically be opened and re-generate 
MYSCREEN.SPR file from the modified MYSCREEN.SCX. If 
AutoGenerate parameter is .T., the .SCX was preprocessed by 
GENSCRNX, and the scree was built from within a project, then the 
project will be reopened and built if any changes occur.

Example:
=SPRTOSCX('MYSCREEN.PRG',.F.,'TESTSCRN.SCX')
  or
DO SPRTOSCX WITH 'MYSCREEN.PRG',.F.,'TESTSCRN.SCX'
Update 'TESTSCRN.SCX from changes made to MYSCREEN.PRG.  
The number of snippets updated is returned.

Important:
If SPRTOSCX.PRG is not in FoxPro's PATH, then DO SPRTOSCX must 
be used instead of =SPRTOSCX() since functions cannot specify 
directory paths.




COPYRIGHT NOTICE


Compressed file: SPRTOSCX.ZIP
System: GenScrnX
Author: Ken R. Levy
Copyright: None (Public Domain)

All source code and documentation contained in SPRTOSCX.ZIP was 
developed by Ken Levy and has been placed into the public domain.  You 
may use, modify, copy, distribute, and demonstrate any source code, 
example programs, or documentation contained in SPRTOSCX.ZIP freely 
without copyright protection.  All files contained in SPRTOSCX.ZIP are 
provided 'as is' without warranty of any kind.  In no event shall its authors, 
contributors, or distributors be liable for any damages.




COMMENTS/SUGGESTIONS/PROBLEMS/QUESTIONS


Please use CompuServe's FoxForum (section 3rd Party Products) 
directed to:

Ken Levy 76350,2610

-----------------------------------------------------------

