home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / news / 769 / s3browse.prg < prev    next >
Text File  |  1992-08-18  |  2KB  |  69 lines

  1. // browse sampler
  2.  
  3. proc main
  4.  local cInscreen := savescreen(0,0,24,79)
  5.  local aMenuDef  := {;
  6.                      {"Dbf  ","Browse DBF",{||bdbfsamp()} },;
  7.                      {"MultiArray   ","Browse a Multi-dimmed array",{||b2dsamp()} },;
  8.                      {"Delimited   ","Browse a Delimited file",{||bdelsamp()} },;
  9.                      {"SDF   ","Browse an SDF file",{||bsdfsamp()} },;
  10.                      {"Quit ","Exit the demo",nil};
  11.                      }
  12.  slsf_color("S3COLOR")
  13.  initsup(.f.)
  14.  setcolor(sls_normcol())
  15.  dispbox(0,0,24,79,"┌─┐│┘─└│▒",sls_normcol())
  16.  makebox(8,22,13,53)
  17.  @ 9,24 SAY "SuperLib 3.0 Sample Program"
  18.  @ 11,30 SAY "B R O W S I N G"
  19.  
  20.  
  21.  @3,1 to 3,78
  22.  
  23.  slotusmenu(1,1,1,78,aMenudef,.f.,.f.,.f.)
  24.  slotusclear()
  25.  
  26.  ss_fade(0,0,24,79,cInscreen)
  27. return
  28.  
  29.  
  30. static proc bdelsamp
  31.     if !file("S3SAMPLE.ASC")
  32.       msg("Missing file S3SAMPLE.ASC")
  33.     else
  34.       browsedelim("s3sample.asc",{"First","Last","Due","Date"},;
  35.                        {"C","C","N","D"},;
  36.                        {15,25,6,8})
  37.     endif
  38. return
  39.  
  40. static proc bsdfsamp
  41.     if !file("S3SAMPLE.SDF")
  42.       msg("Missing file S3SAMPLE.SDF")
  43.     else
  44.       browseSDF("s3sample.sdf",{"Last","First","Due","Date"},;
  45.                          {"C","C","N","D"},;
  46.                          {20,15,8,8})
  47.     endif
  48. return
  49.  
  50. static proc b2dsamp
  51.     local a := directory()
  52.     browse2d(5,5,20,60,a,{"File","Size","Date","Time","Attribute"},,;
  53.       "Choose a File", {|k|amsg({k,"is not a valid key"})}  )
  54. return
  55.  
  56. static proc bdbfsamp
  57.     if !file("S3SAMPLE.DBF")
  58.       msg("Missing file S3SAMPLE.DB?")
  59.     else
  60.       if snet_use("S3SAMPLE","S3SAMPLE",.F.,5,.T.,;
  61.             "Unable to open S3SAMPLE. Keep trying?")
  62.          editdb(.T.)
  63.          use
  64.       endif
  65.     endif
  66. return
  67.  
  68.  
  69.