home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / clipper / sup35s / s3popup.prg < prev    next >
Text File  |  1992-08-18  |  3KB  |  100 lines

  1.  
  2. PROC MAIN
  3. local cMainScreen := savescreen(0,0,24,79)
  4. local cSuper, cInScreen
  5. local nChoice := 1
  6. local aOptions,aSelect
  7.  
  8. slsf_color("S3COLOR")
  9. initsup(.F.)
  10. if iscolor()
  11.   setblink(.f.)
  12. endif
  13. SETCOLOR(SLS_NORMCOL())
  14. SET WRAP ON
  15.  
  16. cSuper  := "S"+chr(15)+"u"+chr(31)+"p"+chr(47)+"e"+chr(63)+"r"+chr(79)+"L"+chr(95)+"i"+chr(111)+"b"+chr(127)+"!"+chr(11)
  17. cSuper  := left(repl(cSuper,223),4000)
  18. SS_RISE(0,0,24,79,cSuper)
  19. cSuper  := "P"+chr(9)+"o"+chr(9)+"p"+chr(9)+"u"+chr(9)+"p"+chr(9)+"s"+chr(9)+" "+chr(9)+"e"+chr(9)+"t"+chr(9)+"c"+chr(9)+"."+chr(9)
  20. cSuper  := left(repl(cSuper,96),2112)
  21. dispbox(3,3,22,72,space(9))
  22. SS_FADE(5,5,20,70,cSuper)
  23. cInScreen := savescreen(5,5,20,70)
  24.  
  25. aOptions := makeoptions()
  26. aSelect  := a2tosing(aOptions,1)
  27.  
  28. if checkdbfs()
  29.   do while .t.
  30.       dispbox(5,24,20,51,space(9))
  31.       scroll(6,25,19,50,0)
  32.  
  33.       nChoice := SACHOICE(6,25,19,50,aSelect,nil,nChoice)
  34.  
  35.       if nChoice = len(aOptions) .or. nChoice == 0
  36.            exit
  37.       else
  38.            eval(aOptions[nChoice,2])
  39.       endif
  40.   enddo
  41. endif
  42. ss_implode(0,0,24,79,cMainScreen)
  43.  
  44.  
  45. static function makeoptions
  46. local aOptions := {;
  47.      {"AMSG()       ",{||amsg({"This is a message","passed as an array",;
  48.                                "which can contain","Character, numeric",;
  49.                                "or date style ","elements",date(),diskspace();
  50.                                 })} },;
  51.      {"ASCIITABLE() ",{||ASCIITABLE()} },;
  52.      {"DELREC()     ",{||DELREC()} },;
  53.      {"EDITMEMO()   ",{||MSG("About to edit the memo field MEMO"),;
  54.                          EDITMEMO("MEMO")} },;
  55.      {"EDITMEMOV()  ",{||MSG("About to edit the PRG file S3POPUP.PRG"),;
  56.                          EDITMEMOV(MEMOREAD("S3POPUP.PRG"))} },;
  57.      {"GETCALC()    ",{||GETCALC()} },;
  58.      {"GETDATE()    ",{||GETDATE()} },;
  59.      {"HARDCOPY()   ",{||HARDCOPY()} },;
  60.      {"MCHOICE()    ",{||MCHOICE(afieldsx(),nil,nil,nil,nil,"Pick a Field")} },;
  61.      {"MESSYN()     ",{||MESSYN("Is this what you're looking for?")} },;
  62.      {"MFIELDS()    ",{||mfields("Select a field")} },;
  63.      {"MFIELDSTYPE()",{||mfieldstype("C","Select a NUMERIC field")} },;
  64.      {"MULTIMSGYN() ",{||multimsgyn({"Would you like","to make","a selection?"},;
  65.                          "OK","Cancel")} },;
  66.      {"POPCOLSEL()  ",{||popcolsel()} },;
  67.      {"POPEX()      ",{||POPEX("*.PRG")} },;
  68.      {"POPUPDIR()   ",{||POPUPDIR(NIL,NIL,NIL,NIL,.T.)} },;
  69.      {"SPOPORDER()  ",{||SPOPORDER()} },;
  70.      {"SPOPSEEK()   ",{||SPOPSEEK(),VERTVIEW()} },;
  71.      {"STAGFIELDS() ",{||STAGFIELDS(nil,"Tag Fields")} },;
  72.      {"TAGARRAY()   ",{||TAGARRAY(A2TOSING(DIRECTORY(),1))} },;
  73.      {"TAGMARRAY()  ",{||TAGMARRAY(DIRECTORY())} },;
  74.      {"VERTVIEW()   ",{||VERTVIEW()} },;
  75.      {"VIEWMEMOS()   ",{||VIEWMEMOS()} },;
  76.      {"SATTPICK()   ",{||SATTPICK()} },;
  77.      {"Quit          ",{||nil} };
  78.      }
  79.  
  80. return aOptions
  81.  
  82.  
  83. static function checkdbfs
  84. local ldbfsOK := .f.
  85. if !( file("s3sample.dbf") .and. file("s3sample.dbt") )
  86.   msg("Missing files - S3SAMPLE.DB*")
  87. elseif SNET_USE("s3sample","s3sample",.f.,5,.t.,"Unable to open S3SAMPLE. Try again?")
  88.   ldbfsOK := .t.
  89.   if !( file("s3samp1.ntx") .and. file("s3samp2.ntx") )
  90.      ProgIndex("S3SAMP1","LNAME",.f.,.t.,.f.)
  91.      ProgIndex("S3SAMP2","ZIP",.f.,.t.,.f.)
  92.      set index to s3samp1,s3samp2
  93.   else
  94.     set index to s3samp1,s3samp2
  95.   endif
  96. endif
  97. return ldbfsOk
  98.  
  99.  
  100.