local lnErrorRows,lnXX
e:\bradutils\covprofaddin\927version\senttojim1001\1024version\demo files\demo.dbc
rierror
.dct
lnErrorRows=alen(gaErrors,1)
if type('gaErrors[lnErrorRows,1]')<>"L"
gaErrors[lnErrorRows,1]=tnErrNo
gaErrors[lnErrorRows,2]=tcMessage
gaErrors[lnErrorRows,3]=tcCode
gaErrors[lnErrorRows,4]=""
lnXX=1
do while !empty(program(lnXX))
program(lnXX)
lnXX=lnXX+1
enddo
gaErrors[lnErrorRows,5]=pcParentDBF
gaErrors[lnErrorRows,6]=pnParentRec
gaErrors[lnErrorRows,7]=pcParentID
gaErrors[lnErrorRows,8]=pcParentExpr
gaErrors[lnErrorRows,9]=pcChildDBF
gaErrors[lnErrorRows,10]=pnChildRec
gaErrors[lnErrorRows,11]=pcChildID
gaErrors[lnErrorRows,12]=pcChildExpr
return tnErrNo
LOCAL lcCurWkArea,lcNewWkArea,lnInUseSpot,lnOccurs,lnOccurance
riopen
lnInUseSpot=0
lnOccurs = OCCURS(UPPER(tcTable)+"*",UPPER(pcRIcursors))
FOR lnOccurance = 1 TO lnOccurs
IF lnInUseSpot=0
lcCurWkArea=select()
SELECT 0
lcNewWkArea=select()
IF NOT EMPTY(tcOrder)
ALIAS ("__ri"+LTRIM(STR(SELECT()))) share
if pnerror=0
pcRIcursors=pcRIcursors+upper(tcTable)+"?"+STR(SELECT(),5)
RETURN (lcNewWkArea)
local lnXX,lnSpot,lcWorkArea
riend
IF tlSuccess
SET DELETED OFF
ROLLBACK
SET DELETED ON
IF EMPTY(pcRIolderror)
ON ERROR &pcRIolderror.
FOR lnXX=1 TO occurs("*",pcRIcursors)
lnSpot=atc("*",pcRIcursors,lnXX)+1
USE IN (VAL(substr(pcRIcursors,lnSpot,5)))
ENDFOR
IF pcOldCompat = "ON"
IF pcOldDele="OFF"
IF pcOldExact="ON"
IF pcOldTalk="ON"
SET TALK ON
do case
case empty(pcOldDBC)
set data to
case pcOldDBC<>DBC()
RETURN .T.
upper(tcTableName)+"*"+str(tcWkArea,5))
rireuse
RETURN .t.
LOCAL llRetVal
__RI_INSERT_demochild
llRetVal = .t.
PRIVATE pcParentDBF,pnParentRec,pcChildDBF,pnChildRec,pcParentID,pcChildID
PRIVATE pcParentExpr,pcChildExpr
STORE "" TO pcParentDBF,pcChildDBF,pcParentID,pcChildID,pcParentExpr,pcChildExpr
STORE 0 TO pnParentRec,pnChildRec
IF _triggerlevel=1
BEGIN TRANSACTION
pcOldDele,pcOldExact,pcOldTalk,pcOldCompat,PcOldDBC
pcOldTalk=SET("TALK")
SET TALK OFF
pcOldDele=SET("DELETED")
pcOldExact=SET("EXACT")
pcOldCompat=SET("COMPATIBLE")
SET COMPATIBLE OFF
SET EXACT OFF
pcRIcursors=""
pcRIwkareas=""
pcRIolderror=ON("error")
pnerror=0
ON ERROR pnerror=rierror(ERROR(),message(),message(1),program())
IF TYPE('gaErrors(1)')<>"U"
PUBLIC gaErrors(1,12)
pcOldDBC=DBC()
SET DATA TO ("DEMO")
LOCAL lcChildID && child's value to be sought in parent
LOCAL lcParentWkArea && parentwork area handle returned by riopen
LOCAL lcChildWkArea && child's work area
LOCAL lcStartArea
lcStartArea=select()
llRetVal=.t.
lcChildWkArea=SELECT()
SELECT (lcChildWkArea)
lcChildID=F2
pcChildDBF=dbf(lcChildWkArea)
pnChildRec=recno(lcChildWkArea)
pcChildID=lcChildID
pcChildExpr="F2"
lcParentWkArea=riopen("demo","f1")
IF lcParentWkArea<=0
pcParentDBF=dbf(lcParentWkArea)
llRetVal=SEEK(lcChildID,lcParentWkArea)
pnParentRec=recno(lcParentWkArea)
=rireuse("demo",lcParentWkArea)
IF NOT llRetVal
pnError = rierror(-1,"Insert restrict rule violated.","","")
DO riend WITH llRetVal
SELECT (lcStartArea)
RETURN llRetVal
SET SYSMENU TO
e:\bradutils\covprofaddin\927version\senttojim1001\1024version\demo files\demo.mpr
.mpx
SET SYSMENU AUTOMATIC
MESSAGE "Creates, opens, saves, prints files or quits Visual FoxPro"
MESSAGE "Edits text or current selection"
MESSAGE "Changes display options"
MESSAGE "Sets options, runs Wizards and other tools"
MESSAGE "Runs, debugs, compiles, and suspends programs"
MESSAGE "Manipulates windows, displays Command and Data Session windows"
MESSAGE "Displays Help on Visual FoxPro"
ON PAD _msm_file OF _MSYSMENU ACTIVATE POPUP _mfile
ON PAD _msm_edit OF _MSYSMENU ACTIVATE POPUP _medit
ON PAD _msm_view OF _MSYSMENU ACTIVATE POPUP _mview
ON PAD _msm_tools OF _MSYSMENU ACTIVATE POPUP _mtools
ON PAD _msm_prog OF _MSYSMENU ACTIVATE POPUP _mprog
ON PAD _msm_windo OF _MSYSMENU ACTIVATE POPUP _mwindow
ON PAD _msm_systm OF _MSYSMENU ACTIVATE POPUP _msystem
DEFINE POPUP _mfile MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Creates a new file"
MESSAGE "Opens an existing file"
MESSAGE "Closes the current file"
MESSAGE "Closes all windows"
PICTRES _mfi_sp100
MESSAGE "Saves changes to the current file"
MESSAGE "Saves changes to the current file with a new name"
MESSAGE "Saves the current file as HTML"
MESSAGE "Reverts the current file to the last saved version"
PICTRES _mfi_sp200
MESSAGE "Imports a Visual FoxPro file or a file from another application"
MESSAGE "Exports a Visual FoxPro file to another application's file"
PICTRES _mfi_sp300
MESSAGE "Changes the page layout and printer settings"
MESSAGE "Displays full pages as they will be printed"
MESSAGE "Prints a text file, report, label, contents of the Command window, or contents of the Clipboard"
MESSAGE "Displays Mail window for sending e-mail"
PICTRES _mfi_sp400
MESSAGE "Quits Visual FoxPro"
DEFINE POPUP _medit MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Undoes the last command or action"
MESSAGE "Repeats the last command or action"
PICTRES _med_sp100
MESSAGE "Removes the selection and places it onto the Clipboard"
MESSAGE "Copies the selection onto the Clipboard"
MESSAGE "Pastes the contents of the Clipboard"
MESSAGE "Pastes the Clipboard contents as a linked object, embedded object, or other object type"
MESSAGE "Removes the selection and does not place it onto the Clipboard"
PICTRES _med_sp200
MESSAGE "Selects all text or items in the current window"
PICTRES _med_sp300
MESSAGE "Searches for specified text"
MESSAGE "Replaces specified text with different text"
PICTRES _med_sp400
MESSAGE "List members of the selected object"
MESSAGE "Quick information on the selected object"
PICTRES _med_sp500
MESSAGE "Bookmark options"
DEFINE BAR 19 OF _medit PROMPT "\-"
MESSAGE "Embeds an object in a General field type"
MESSAGE "Edits the selected object"
MESSAGE "Opens linked files or changes links"
DEFINE BAR 23 OF _medit PROMPT "\-"
MESSAGE "Set editor properties"
ON BAR 18 OF _medit ACTIVATE POPUP _med_bkmks
DEFINE POPUP _med_bkmks MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Adds a Shortcut for current line"
MESSAGE "Toggles bookmark for current line"
MESSAGE "Go to the next bookmark or shortcut in the file"
MESSAGE "Go to the previous bookmark or shortcut in the file"
DEFINE POPUP _mview MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Shows, hides, or customizes toolbars"
DEFINE POPUP _mtools MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Runs the selected wizard"
PICTRES _mtl_sp100
MESSAGE "Creates, deletes, or revises a keyboard macro"
MESSAGE "Runs the Class Browser"
MESSAGE "Runs the Component Gallery"
MESSAGE "Browse installed OLE objects"
MESSAGE "Runs the IntelliSense Manager"
MESSAGE "Runs the Task Pane application"
MESSAGE "Displays the toolbox to assist in application development"
PICTRES _mtl_sp200
MESSAGE "Beautify a program"
MESSAGE "Displays the Task List window"
MESSAGE "Displays the Document View window"
MESSAGE "Runs the Code References application"
PICTRES _mtl_sp300
MESSAGE "Runs the Coverage Profiler"
MESSAGE "Display the Breakpoints dialog"
MESSAGE "Displays the debugger"
PICTRES _mtl_sp400
MESSAGE "Changes various categories for Visual FoxPro options"
ON BAR 1 OF _mtools ACTIVATE POPUP _mwizards
DEFINE POPUP _mwizards MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Runs the Table Wizard"
MESSAGE "Runs the Query, Cross-Tab, Graph, Local View, and Remote View Wizards"
MESSAGE "Runs the Form and One-to-Many Form Wizards"
MESSAGE "Runs the Report and One-to-Many Report Wizards"
MESSAGE "Runs the Label Wizard"
MESSAGE "Runs the Mail Merge Wizard"
MESSAGE "Runs the PivotTable Wizard"
MESSAGE "Runs the Import Wizard"
MESSAGE "Runs the Documenting Wizard"
MESSAGE "Runs the Upsizing Wizard"
MESSAGE "Runs the Application Wizard"
MESSAGE "Runs the Database Wizard"
MESSAGE "Runs the Web Publishing Wizard"
MESSAGE "Runs the Web Services Wizard"
MESSAGE "Displays a list of all wizards"
DEFINE POPUP _mprog MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Runs a program, application, form, report, query, or menu"
MESSAGE "Stops running the current program"
MESSAGE "Resumes running the current suspended program"
MESSAGE "Suspends the currently running program"
PICTRES _mpr_sp100
MESSAGE "Compiles the current or selected program"
DEFINE POPUP _mwindow MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Arranges windows as cascading tiles"
MESSAGE "Arranges windows as non-overlapping tiles"
PICTRES _mwi_sp100
MESSAGE "Enable docking of this window"
MESSAGE "Hides the active window"
MESSAGE "Hides all windows"
MESSAGE "Shows all hidden windows"
PICTRES _mwi_sp200
MESSAGE "Clears text from the application workspace or the current output window"
MESSAGE "Cycles through all open windows"
MESSAGE "Displays the Command window"
MESSAGE "Displays the Data Session window"
MESSAGE "Display the Properties window"
DEFINE POPUP _msystem MARGIN RELATIVE SHADOW COLOR SCHEME 4
MESSAGE "Locates Help topics based on keywords you enter"
MESSAGE "Provides access to MSDN Search tab."
PICTRES _mst_sp100
MESSAGE "Provides information on how to obtain additional technical help"
MESSAGE "Launches your web browser to go to Visual FoxPro's Web sites"
PICTRES _mst_sp300
MESSAGE "Displays version and copyright information about Visual FoxPro"
olderror=ON("error")
e:\bradutils\covprofaddin\927version\senttojim1001\1024version\demo files\demo.prg
.fxp
x=1
y=1
USE demo IN 0
USE demochild IN 0
ON ERROR errh()
insert into demochild values("12","12")
insert into demochild values("1","1")
oform=NEWOBJECT('frmotherlib',"demo2.vcx")
REPORT FORM report1 PREVIEW nowait
RELEASE WINDOWS Report Designer
DO demo.mpr
SET SYSMENU TO default
DO demoquery.qpr
USE IN demochild
WAIT WINDOW MESSAGE() TIMEOUT 1
errh
cstr=''
sub1
e:\bradutils\covprofaddin\927version\senttojim1001\1024version\demo files\demo.vcx
frmbase!frmbase.Init
frmbase!frmbase
.vct
DODEFAULT()
frmsameclasslib!frmsameclasslib.Init
frmsameclasslib!frmsameclasslib
x=100
y=111
FOR zz=1 TO y
x=x+1
INTO CURSOR Demoquery
e:\bradutils\covprofaddin\927version\senttojim1001\1024version\demo files\demoquery.qpr
.qpx
WAIT WINDOW "AfterOpenTables" TIMEOUT 1
e:\bradutils\covprofaddin\927version\senttojim1001\1024version\demo files\report1.frx
dataenvironment.AfterCloseTables
dataenvironment
.frt
WAIT WINDOW "BeforeOpenTables" TIMEOUT 1
dataenvironment.BeforeOpenTables