home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a046 / 5.img / TEMPLATE / SSBKEYS.INC < prev    next >
Encoding:
Text File  |  1992-04-01  |  2.1 KB  |  99 lines

  1. <<* SSBKEYS.INC *>>
  2. <<* (C) 1991 SHEN YANG WHITE HORSE SOFTWART COMPANY  *>>
  3. <<#
  4.  
  5. procedure GenIsBlank
  6. string strg
  7. begin
  8.   forall fields
  9.     if forcount = 1
  10.       strg := ''
  11.     else
  12.       strg := 'IsBlank .OR. '
  13.     endif
  14.     if fldtyp = 'N'
  15.       genln( 'IsBlank = ',strg,'(',fixfldnam,' = 0)' )
  16.     elsif fldtyp = 'D'
  17.       genln( 'IsBlank = ',strg,'(DTOC( ',fixfldnam,' ) = "  /  /  ")' )
  18.     else
  19.       genln( 'IsBlank = ',strg,'("" = TRIM( ',fixfldnam,' ))' )
  20.     endif
  21.   endfor
  22. end GenIsBlank
  23.  
  24.  
  25. procedure GenKeysBody  <<*Assumes ndxtotal > 0 *>>
  26. string  keyexpr
  27. begin
  28.   if ndxtotal > 0
  29.     <<* Use the first index as MASTER index *>>
  30.     select index 1
  31.   endif
  32.   select fields on upper(fldnam) $ upper(ndxkey)
  33.   if fldtotal = 0
  34. #>>
  35. * ---Key expression:  {ndxkey}
  36. DO SayLine WITH PromptRow,"╣╪╝ⁿ╫╓▒φ┤∩╩╜╙δ╩²╛▌┐Γ╬─╝■▓╗╞Ñ┼Σ."
  37. WAIT
  38. @ PromptRow,0 CLEAR
  39. <<#
  40.   else
  41.     WriteGetFlds
  42.     GenIsBlank
  43.     genln( 'expr = ',fixautomem(ndxkey) )
  44.     if ndxuni
  45.       genln( 'IsUnique = .T.' )
  46.     else
  47.       genln( 'IsUnique = .F.' )
  48.     endif
  49.   endif
  50.   select all fields
  51. end GenKeysBody
  52. #>>
  53.  
  54.  
  55. <<procedure GenKeysProc>>
  56. <<begin>>
  57.  
  58. PROCEDURE {fileprefix}K
  59. PARAMETER expr,IsBlank,IsUnique
  60.   ?? SYS(2002,1)  && TURN CURSOR ON
  61.    expr = ""
  62.    IsBlank = .F.
  63.    IsUnique = .F.
  64. <<#
  65.   if ismultials
  66.     pushmargin( 1 )
  67.     genln( 'DO CASE' )
  68.     forall databases
  69.       genln( 'CASE dbfarea = "',dbfcount,'"' )
  70.       pushmargin( 1 )
  71.       if ndxtotal = 0
  72.         genln( '* ---No index file available to check' )
  73.         genln( '* ---for BLANK or duplicate records.' )
  74.       else
  75.         GenKeysBody
  76.       endif
  77.       popmargin
  78.     endfor
  79.     genln( 'ENDCASE' )
  80.     popmargin
  81.   else
  82.     pushmargin( 1 )
  83.     select database 1
  84.     if ndxtotal = 0
  85.       genln( '* ---No index file available to check' )
  86.       genln( '* ---for BLANK or duplicate records.' )
  87.     else
  88.       GenKeysBody
  89.     endif
  90.     popmargin
  91.   endif
  92.   genln( '?? SYS(2002)    && TURN CURSOR OFF' )
  93.   genln( 'RETURN' )
  94.   genln
  95. end <<*GenKeysProc*>>
  96.  
  97. <<* EOF: SSBKEYS.INC *>>
  98. #>>
  99.