home *** CD-ROM | disk | FTP | other *** search
- <<* APPKEYS.INC *>>
- <<#
-
- procedure GenIsBlank
- string strg
- begin
- forall fields
- if forcount = 1
- strg := ''
- else
- strg := 'IsBlank .OR. '
- endif
- if fldtyp = 'N'
- genln( 'IsBlank = ',strg,'(',fixfldnam,' = 0)' )
- elsif fldtyp = 'D'
- genln( 'IsBlank = ',strg,'(DTOC( ',fixfldnam,' ) = " / / ")' )
- else
- genln( 'IsBlank = ',strg,'("" = TRIM( ',fixfldnam,' ))' )
- endif
- endfor
- end GenIsBlank
-
-
- procedure GenKeysBody <<*Assumes ndxtotal > 0 *>>
- string keyexpr
- begin
- if ndxtotal > 0
- <<* Use the first index as MASTER index *>>
- select index 1
- endif
- select fields on upper(fldnam) $ upper(ndxkey)
- if fldtotal = 0
- #>>
- * ---Key expression: {ndxkey}
- DO SayLine WITH PromptRow,"Key expression does not match database file."
- WAIT
- @ PromptRow,0 CLEAR
- <<#
- else
- WriteGetFlds
- GenIsBlank
- genln( 'expr = ',fixautomem(ndxkey) )
- if ndxuni
- genln( 'IsUnique = .T.' )
- else
- genln( 'IsUnique = .F.' )
- endif
- endif
- select all fields
- end GenKeysBody
- #>>
-
-
- <<procedure GenKeysProc>>
- <<begin>>
-
- PROCEDURE {fileprefix}_KEYS
- PARAMETER expr,IsBlank,IsUnique
- ?? SYS(2002,1) && TURN CURSOR ON
- expr = ""
- IsBlank = .F.
- IsUnique = .F.
- <<#
- if ismultials
- pushmargin( 1 )
- genln( 'DO CASE' )
- forall databases
- genln( 'CASE dbfarea = "',dbfcount,'"' )
- pushmargin( 1 )
- if ndxtotal = 0
- genln( '* ---No index file available to check' )
- genln( '* ---for BLANK or duplicate records.' )
- else
- GenKeysBody
- endif
- popmargin
- endfor
- genln( 'ENDCASE' )
- popmargin
- else
- pushmargin( 1 )
- select database 1
- if ndxtotal = 0
- genln( '* ---No index file available to check' )
- genln( '* ---for BLANK or duplicate records.' )
- else
- GenKeysBody
- endif
- popmargin
- endif
- genln( '?? SYS(2002) && TURN CURSOR OFF' )
- genln( 'RETURN' )
- genln
- end <<*GenKeysProc*>>
-
- <<* EOF: MSAKEYS.INC *>>
- #>>