home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR7 / FOXTAILS.ZIP / FOXTAILS.PRG < prev    next >
Text File  |  1992-06-13  |  31KB  |  814 lines

  1. *    Written by R.L. Coppedge
  2. *    Copyright 1992 dbF Software Productions
  3. *    By the way, dbF also has:
  4. *    SysTrak        A Computer Hardware/Software Inventory System
  5. *    Flags        A Flatfile Application Gen. for Executable,db3,4 and Fox
  6. *    ClasAdz        A Classified/Notice system for Networks in Exe and Fox
  7. *    FoxTails #2    A collection of FoxPro tools (like these)
  8. *    Contact dbF for more information.
  9. *    dbF Software Productions
  10. *    P.O. Box 37194
  11. *    Cleve., Ohio 44137-0194
  12. *    CIS: 72117,165
  13. *    Prodigy: XRCG88A
  14. *    (216)491-4581
  15. *
  16. *
  17. Vw = SYS(3)
  18. CREATE VIEW (Vw)
  19. SET TALK OFF
  20. SET SAFETY OFF
  21. SET EXCLUSIVE OFF
  22. SET HELP TO Foxtails
  23. PUSH KEY
  24. ON KEY LABEL F1 HELP
  25. CLEAR WINDOWS
  26. CLEAR
  27. DO Sign WITH "Fox",7,15,"T"
  28. DO Sign WITH "Tails #1",14,5,"L"
  29. =INKEY(5)
  30. CLEAR
  31. DEFINE WINDOW Hooplah FROM 1,5 TO 6,75 DOUBLE TITLE "> The scoop... <"
  32. ACTIVATE WINDOW Hooplah
  33. @0,5 SAY "This program will give you a demonstration"
  34. @1,5 SAY "of the capabilities that FoxTails give you!"
  35. @2,5 SAY "Simply select which tool you want to see."
  36. @3,5 SAY "We'll take care of the rest!     V1.01"
  37. DEFINE WINDOW Arena FROM 7,7 TO 22, 75 DOUBLE TITLE "> The choices... <" FOOTER " Select an Option, or <Esc> To Exit "
  38. ACTIVATE WINDOW Arena
  39. DECLARE Vr(13)
  40. Vr(1) = "WPCONV"
  41. Vr(2) = "SIGN"
  42. Vr(3) = "PICKPOP"
  43. Vr(4) = "MKEY"
  44. Vr(5) = "LOOKUP"
  45. Vr(6) = "GET_DATE"
  46. Vr(7) = "DBFIXED"
  47. Vr(8) = "REORG"
  48. Vr(9) = "STEP"
  49. Vr(10) = "CPACK"
  50. Vr(11) = "REGISTER"
  51. Vr(12) = "HELP"
  52. Vr(13) = "QUIT"
  53. SET TOPIC TO Vr(_Curobj)
  54. Quitting = .F.
  55. *          01234567891123456789212345678931234567894123456789512345678961234
  56. *          *           *            *            *            *            *
  57. @ 0,0 SAY "   Wpconv        Sign        Pickpop       Mkey         Look"
  58. @ 2,0 SAY " Word Perf.      Sign          GET         Keybd        Power"
  59. @ 3,0 SAY " Converter       Maker        Valid       Emulator     Browse"
  60. @ 6,0 SAY "  Get_date      dbFixed       Reorg         Step         Cpack"
  61. @ 8,0 SAY "  Calendar       File         Index         Number       Pack"
  62. @ 9,0 SAY "    Tool       Importer     Rebuilder      Stepper     W/Char's"
  63. @11,5 SAY "Documentation...Register...How do I pay for this thing?"
  64. @12,7 SAY "Help...As in more information...as in...What's Up??"
  65. @13,6 SAY "Outta here!  Exit!!  Adios!!!  Goodbye!!!!  Done!!!!!"
  66. @ 0, 1 GET Ch1 FUNCTION '*IH ;;;;' SIZE 5,12,1 VALID Doit(1) MESSAGE "Choose me to look at some tools!" DEFAULT 1
  67. @ 6, 1 GET Ch2 FUNCTION '*IH ;;;;' SIZE 5,12,1 VALID Doit(2) MESSAGE "Choose me to look at some tools" DEFAULT 1
  68. @11,1 GET Ch3 FUNCTION "*I " SIZE 1,64,1 VALID Doit(3) MESSAGE "Honesty dictates you should read this..." DEFAULT 1
  69. @12,1 GET Ch4 FUNCTION "*I " SIZE 1,64,1 VALID Doit(4) MESSAGE "I need to know more about this!!" DEFAULT 1
  70. @13,1 GET Ch5 FUNCTION "*IT " SIZE 1,64,1 MESSAGE "Outta here!  I'm impressed enough!" DEFAULT 1
  71. READ CYCLE
  72. ACTIVATE SCREEN
  73. @24,0
  74. DEFINE WINDOW Ferret FROM 9,15 TO 23,65 DOUBLE TITLE "...and the dues"
  75. ACTIVATE WINDOW Ferret
  76. @1,2 SAY "If you've enjoyed this and would like to see"
  77. @2,2 SAY "other FoxPro 2.0 Tools (Some of which are even"
  78. @3,2 SAY "more exciting), send $25(US) to:"
  79. @5,2 SAY "dbF Software Productions"
  80. @6,2 SAY "P.O. Box 37194"
  81. @7,2 SAY "Cleve., Ohio 44137-0194"
  82. @8,2 SAY "CIS: 72117,165"
  83. @9,2 SAY "(216)491-4581"
  84. @11,3 SAY "Member ASP"
  85. WAIT WINDOW
  86. CLEAR WINDOWS
  87. SET VIEW TO (Vw)
  88. DELETE FILE (Vw+".VUE")
  89. SET HELP TO
  90. RETURN
  91.  
  92.  
  93. FUNCTION Doit
  94. PARAMETER Which
  95. ACTIVATE SCREEN
  96. @24,0
  97. HIDE WINDOW Hooplah, Arena
  98. DO CASE
  99.     CASE Which=1 AND Ch1 = 1        &&    Wpconv
  100.     DO Dwpconv
  101.     CASE Which=1 AND Ch1 = 2        &&    Sign
  102.     DO Dsign
  103.     CASE Which=1 AND Ch1 = 3        &&    Pickpop
  104.     DO Dpickpop
  105.     CASE Which=1 AND Ch1 = 4        &&    Mkey
  106.     DO DMkey
  107.     CASE Which=1 AND Ch1 = 5        &&    Lookup
  108.     DO DLookup
  109.     CASE Which=2 AND Ch2 = 1        &&    Get_date
  110.     DO DGet_Date
  111.     CASE Which=2 AND Ch2 = 2        &&    dbFixed
  112.     DO DdbFixed
  113.     CASE Which=2 AND Ch2 = 3        &&    Reorg
  114.     DO DReorg
  115.     CASE Which=2 AND Ch2 = 4        &&    Step
  116.     DO DStep
  117.     CASE Which=2 AND Ch2 = 5        &&    CPack
  118.     DO DCpack
  119.     CASE Which=3                    &&    Register
  120.     DO Reginfo
  121.     CASE Which=4                    &&    Help
  122.     HELP Help
  123. ENDCASE
  124. SHOW WINDOW Hooplah, Arena
  125. _CUROBJ=11
  126. SHOW GETS
  127. RETURN .T.
  128.  
  129. PROCEDURE Dwpconv
  130. USE PEOPLE
  131. SET TALK OFF
  132. DEFINE WINDOW WpConv FROM 5,2 TO 19,60 DOUBLE TITLE "WPCONV"
  133. ACTIVATE WINDOW Wpconv
  134. @0,5 SAY "Word Perfect Secondary Text File Creator....."
  135. @2,5 SAY "This will take the database People and create"
  136. @3,5 SAY "a file called Tst.txt which can then be used"
  137. @4,5 SAY "for a Word Perfect MailMerge"
  138. @5,5 SAY "The call for this is a simple:"
  139. @6,15 SAY "=WPCONV('Tst.Txt',@Tst)"
  140. @7,5 SAY "Where we've created an array called 'Tst'"
  141. @8,5 SAY "which contains an element for each field or"
  142. @9,5 SAY "function you want in the Output file 'Tst.Txt'"
  143. @10,5 SAY "See the documentation for information about"
  144. @11,5 SAY "other parameters..."
  145. WAIT WINDOW
  146. DECLARE Tst(8)            &&    We declare the array to be equal to the
  147. Tst(1)= 'F_name'        &&    number of fields we're sending to the
  148. Tst(2)= 'MI'            &&    UDF.  We then fill each one with the
  149. Tst(3)= 'L_name'        &&    NAME of the field, not the value!
  150. Tst(4)= 'Title'
  151. Tst(5)= 'H_Date'
  152. Tst(6)= 'Salary'
  153. Tst(7)= 'Ugly'
  154. Tst(8)= 'DATE()'        &&    Oooh!  Functions work too!
  155. *    We selected ALL of the fields in the People database.  You
  156. *    wouldn't have to (unless so inclined...)
  157. GO TOP
  158. *    Here's where we'd set up a filter or conditional index
  159. *    to select the ones we want.
  160. *    Send a 3rd parameter ('.T.') if you want
  161. *    a blank record to be inserted at the beginning
  162. *    Send a 4th parameter (which would force you to send
  163. *    a 3rd one as well) which would override the default
  164. *    ',' field delimited used by Word Perfect
  165. =WPCONV('Tst.Txt',@Tst)
  166. DO Dsprpt WITH "Demo file of WPConv", "Tst.Txt"
  167. WAIT "We're done...tap any key" WINDOW
  168. CLOSE DATA
  169. RELEASE WINDOW WpConv
  170. RETURN
  171.  
  172.  
  173. PROCEDURE DSign
  174. SET TALK OFF
  175. DEFINE WINDOW DSign FROM 0,0 TO 22,79 DOUBLE TITLE "Sign"
  176. ACTIVATE WINDOW DSign
  177. *    We'll do 3 tests.  1st, we'll popup the string "IT'S" starting
  178. *    at position 1,15 from the top with 0 delay.
  179. WAIT "1st, popup a string starting at 1,15 with 0 delay" WINDOW
  180. DO Sign WITH "IT'S",1,15,"T"
  181. *    Next we'll do "FERRET" (always a favourite, don't you agree?)
  182. *    from 8,1 scrolling from the right with a .1 second delay
  183. *    between updates
  184. =INKEY(2)
  185. WAIT "Next, popup a string at 8,1 from the right with .1 Sec delay" WINDOW
  186. DO Sign WITH "FERRET", 8,1,"R",.1
  187. *    And finally, the string "TIME!" appears starting at 15,10
  188. *    scrolling left, also with a .1 delay.
  189. WAIT "Finally, a string at 15,10 from the left with .1 Sec delay" WINDOW
  190. DO Sign WITH "TIME!", 15,10,"L",.01
  191. *    Boy, was that fun!
  192. WAIT WINDOW TIMEOUT 4
  193. RELEASE WINDOW DSign
  194. RETURN
  195.  
  196.  
  197. PROCEDURE Dpickpop
  198. *    Ok...this may seem confusing...actually, it may BE confusing, but
  199. *    bear with me.  What we're gonna do is to demonstrate how PICKPOP
  200. *    can be used in a variety of ways...1st we have to USE the databases
  201. *    that Pickpop will call
  202. DEFINE WINDOW Pickpop FROM 4,10 TO 12,70 DOUBLE TITLE "Pickpop"
  203. ACTIVATE WINDOW Pickpop
  204. CLOSE DATA
  205. SET TALK OFF
  206. SELECT 0
  207. USE State ORDER St_Code
  208. SELECT 0
  209. USE Title ORDER Ttle
  210. SELECT 0
  211. USE PEOPLE
  212. *    Now, we define the databases here, as opposed to within PICKPOP
  213. *    itself.  That's because PICKPOP can be used for any number of
  214. *    Popups, as opposed to just one.
  215. DEFINE POPUP Title FROM 10,5 TO 16,32 PROMPT FIELD Ttle TITLE "Choose a Title!"
  216. ON SELECTION POPUP Title DEACTIVATE POPUP Title
  217. DEFINE POPUP State FROM 10,35 TO 13,55 PROMPT FIELD St_code+"│"+St_name ;
  218. TITLE "Choose State!"
  219. ON SELECTION POPUP State DEACTIVATE POPUP State
  220. *    Boy, was that a religious experience!
  221. CLEAR
  222. WAIT "1st, let's use these within a standard GET Situation..." WINDOW
  223. REPLACE People.Title WITH "WallyBurger", People.State WITH "XX"
  224. *    Start out Title and State as illegal values...
  225. @2,10 SAY "Title of person: " GET People.Title DEFAULT SPACE(25) VALID ;
  226. Pickpop("Title","Title","Ttle","People.Title","Title.Ttle",.T.,.F.) ;
  227. ERROR "Bad Title...Evil Title..."
  228. *    Now, what the heck did that VALID Mean?!
  229. *    1st        Db is the name of the database that the popup uses...
  230. *    2nd        is the name of the CDX tag that the popup uses...
  231. *    3rd        is the name of the field to be verified...
  232. *    4th        is the expression to be replaced from the POPUP.
  233. *    5th        Is the expression to be validated a Field?
  234. *    6th        Is this a variable STORE (as opposed to a GET?)
  235. @4,5 SAY "State from whence they came: " GET People.State DEFAULT "  " VALID ;
  236. Pickpop("State","State","St_Code","People.State","State.St_Code",.T.,.F.) ;
  237. ERROR "Bad, Nasty State!"
  238. *    Notice we can use a very similar call to bring up a completely
  239. *    separate Popup!
  240. READ
  241. *    But wait, we're not done!
  242. WAIT "Boy, that was fun!  Now, let's do it in a data initialization..." WINDOW
  243. *    We can also use PICKPOP in a non-GET situation.  Just toggle the
  244. *    last parameter to indicate that it isn't a GET.  Then PICKPOP
  245. *    will automatically bring up the popup!
  246. *    (Sharp-eyed people will also notice that I place a different
  247. *    field name into the "s" variable than the example above).
  248. *    Dull-eyed people will wonder why I defined the variable "s"
  249. *    twice.  The first time is because PICKPOP needs to know what
  250. *    type of variable (ie, character) it's getting into.
  251. CLEAR
  252. @1,10 SAY "We've initialized a variable 'S' into which we"
  253. @2,10 SAY "want to place the selected State code.  Instead"
  254. @3,10 SAY "of the traditional SAY/GET code normally used,"
  255. @4,10 SAY "we use Pickpop as part of a Store or = statement,"
  256. @5,10 SAY "which accomplished the same thing! (Using the"
  257. @6,10 SAY "(same Pickpop code and the same Popup menu!)"
  258. S = ' '
  259. S = Pickpop("State","State","St_Code","S","State.St_name",.F.,.T.)
  260. WAIT "Wow...We Chose the state of: " +S WINDOW
  261. CLOSE DATA
  262. RELEASE WINDOW Pickpop
  263. RETURN
  264.  
  265.  
  266. PROCEDURE DMkey
  267. *    Program MKeydemo, which is a sample of the use of
  268. *    the Goshamighty program called Mkey, which allows a user to
  269. *    Actually perform a majority of data entry using just the mouse.
  270. *
  271. *    Now, why would someone want to do that?  Well, as a true couch
  272. *    potato, I could try to claim some level of slouch-saving doing this.
  273. *
  274. *    More importantly (and seriously), it shows how relatively
  275. *    simple it is to maximize the capabilities of the computer
  276. *    for someone who is physically challenged (or whatever the
  277. *    current "politically correct" term is these days) to access
  278. *    programs already written.
  279. *
  280. *    There are other situations where access to the keyboard is limited,
  281. *    I suppose.  Like when my wife hides it from me.
  282. *
  283. *    Now, how would you use this program? Welllll....like this:
  284. *
  285. *    The key thing is to include Mkey(Var, length) in any VALID statement
  286. *    so that it would be called.  It would also help to initialize
  287. *    an OKL so that the Right mouse button calls MKey with the proper
  288. *    parameters.  This would allow the program to be
  289. *    called whenever the user tapped the button.
  290. *    Simple, huh?
  291.  
  292. *    Well, there are some limitations.  They are as follows:
  293.  
  294. *    1>    Memo field probably won't work too well here.  I could have
  295. *        included them, and perhaps will in a subsequent release.
  296. *        But they represent a different colored horse story.
  297.  
  298. *    2>    The field must have some kind of default condition.  If
  299. *        it doesn't, Fox will give it a Logical field type, which
  300. *        is pretty useless.
  301.  
  302. *    The parameters are stated as such:
  303. *    Mkey((<expC1>, <expC2> , <expL1> [, <expN>])
  304. *    Where:
  305. *    expC1 is the name of the field
  306. *    expC2 is the initial starting value
  307. *    expL1 is it a GET? (a .F. means it's a STORE)
  308. *    expN1 is the maximum length (for Chr and numeric only)
  309. DEFINE WINDOW Dmkey FROM 0,0 TO 22,79 DOUBLE TITLE "MKey!"
  310. ACTIVATE WINDOW Dmkey
  311.  
  312. ON KEY LABEL RIGHTMOUSE DO Mkey WITH "","",.T.,0
  313.  
  314. @6,10 SAY "Once MKey is up, simply point and shoot at the"
  315. @7,10 SAY "keyboard that shows up on your screen."
  316. @8,10 SAY "Use the Backspace key on the screen, for"
  317. @9,10 SAY "example, to take the last character off"
  318. @10,10 SAY "the Keyboard Buffer, which is the line just"
  319. @11,10 SAY "under 'Data Entered'."
  320. @12,10 SAY "For our 1st example, let's just enter a Date,"
  321. @13,10 SAY "Defaulted as todays date, by calling:"
  322. @14,10 SAY 'Dt = Mkey("Dt",DATE(),.F.)'
  323. WAIT WINDOW
  324. Dt = Mkey("Dt",DATE(),.F.)
  325. WAIT "You chose: " + DTOC(Dt)+" An Excellent choice!" WINDOW
  326. *    As exciting as that was, let's push on...I'll wait a second
  327. *    while you check your pulse.
  328. *    Now, let's do something a little more common.  Let's call it
  329. *    as part of a VALID statement.
  330. CLEAR
  331. WAIT "Now let's get a couple as part of a GET!" WINDOW
  332. Nm = "Larry Linville      "
  333. @2,10 SAY "We've created an OKL (On Key Label) Command"
  334. @3,10 SAY "using the Rightmouse button to trigger MKey."
  335. @4,10 SAY "Specifically, we said:"
  336. @5,10 SAY 'ON KEY LABEL RIGHTMOUSE DO Mkey WITH "","",.T.,0'
  337. @7,10 SAY "Use the left-Mouse button to highlight the"
  338. @8,10 SAY "Field you want to edit, and then tap the"
  339. @9,10 SAY "Right-Mouse button to call Mkey (and click on 'Done'"
  340. @10,10 SAY "when you're finished)"
  341. @12,15 SAY "Who played 'Ferret Face' on M*A*S*H?" GET Nm
  342. @13,15 SAY "And how much was that worth to him (be nice)?" GET Num ;
  343.     PICTURE "999999" DEFAULT 100000 MESSAGE "Be nice now!"
  344. @15,15 GET Dne PICTURE "@*CT \<Done" DEFAULT .F.
  345. READ CYCLE
  346. *
  347. WAIT "We're done...tap any key" WINDOW
  348. ON KEY LABEL RIGHTMOUSE        &&    Remember to reset the OKL
  349. RELEASE WINDOW Dmkey
  350. RETURN
  351.  
  352.  
  353. PROCEDURE Dlookup
  354. SET PROCEDURE TO Lookup
  355. NumLkp = "0"
  356. SELECT A
  357. USE Account ORDER Name IN A
  358. USE Policy ORDER Acct IN B
  359. SET RELATION TO Acc_Pnum INTO Policy
  360. DEFINE WINDOW Acc_Lookup FROM  17, 0 TO 22, 66  FLOAT
  361. ACTIVATE WINDOW Acc_Lookup
  362. @ 0, 1 SAY "<F1>    - Lookup Help"
  363. @ 1, 1 SAY "<F2>    - Edit Account"
  364. @ 2, 1 SAY "<F3>    - Policy (1-Many) Lookup"
  365. @ 3, 1 SAY "Account Lookup Screen - Tap <Esc> to Exit"
  366. PUSH KEY
  367. ON KEY LABEL F1 DO Hlp
  368. ON KEY LABEL F2 DO Edt
  369. ON KEY LABEL F3 DO Pol
  370. DO Lokup WITH "Accounts",' ACCOUNT.ACC_NAME:H="Account Name", ACCOUNT.ACC_PNUM:H="Acc #", ACCOUNT.ACC_STATE:H="State",Fnd=FOUND("Policy"):H="Policy"','';
  371. ,5,0,16,70,ALIAS(),'ACCOUNT','','NONE','NONE'
  372. POP KEY
  373. RELEASE WINDOW Acc_lookup
  374. SET PROCEDURE TO
  375. RETURN
  376.  
  377. PROCEDURE Hlp
  378. *    Part of the Dlookup Routine...this is called when
  379. *    you press the F1 key from the Browse window!
  380. PUSH KEY CLEAR        &&    Remember to Save our old OKL's!
  381. DEFINE WINDOW Hlp FROM 15,5 TO 22,70 DOUBLE TITLE "edit me!"
  382. ACTIVATE WINDOW Hlp
  383. @0,0 SAY "This is help...not much in terms of"
  384. @1,0 SAY "Excitement, but you would put your "
  385. @2,0 SAY "Message here to calm people's nerves..."
  386. X=INKEY(0)
  387. POP KEY        &&    Remember to Reset our old OKL's!
  388. RELEASE WINDOW Hlp
  389. RETURN
  390.  
  391. PROCEDURE Edt
  392. *    Part of the Dlookup Routine...this is called when
  393. *    you press the F2 key from the Browse window!
  394. PUSH KEY CLEAR        &&    Remember to Save our old OKL's!
  395. DEFINE WINDOW EDT FROM 15,5 TO 22,70 DOUBLE TITLE "edit me!"
  396. ACTIVATE WINDOW Edt
  397. @0,0 SAY "Name: " GET Acc_name
  398. @1,0 SAY "Address: " GET Acc_adrs
  399. READ
  400. POP KEY        &&    Remember to Reset our old OKL's!
  401. RELEASE WINDOW Edt
  402. RETURN
  403.  
  404. PROCEDURE Pol
  405. *    Part of the Dlookup Routine...this is called when
  406. *    you press the F3 key from the Browse window!
  407. PUSH KEY CLEAR        &&    Remember to Save our old OKL's!
  408. DEFINE WINDOW Pol_Lookup FROM  18, 10 TO 22, 56  FLOAT
  409. ACTIVATE WINDOW Pol_Lookup
  410. @ 0, 1 SAY "Nested Lookup Window"
  411. @ 1, 1 SAY "Neat, huh?"
  412. @ 2, 1 SAY "Policy Lookup Screen - Tap <Esc> to Exit"
  413. DO Lokup WITH "Policy",' Policy.Pol_acct:H="Policy #", Policy.Status:H="Status", Policy.Pol_Date:H="Date"','';
  414. ,7,10,15,60,ALIAS(),'Policy','Accounts','Account.Acc_Pnum','Account.Acc_pnum'
  415. POP KEY        &&    Remember to Reset our old OKL's!
  416. RELEASE WINDOW Pol_lookup
  417. RETURN
  418.  
  419. PROCEDURE Dget_date
  420. *    This is a sample of the use of the AMAZING program Get_date,
  421. *    which allows the user to point and click at a Date
  422. *    which is displayed calendar-style.
  423. *
  424. *    We're gonna do two things with Get_date.  1st, we're going to
  425. *    show how it's used for an original entry of a date.
  426.  
  427. DEFINE WINDOW DGET_DATE FROM 5,0 TO 20,60 DOUBLE TITLE "Get_Date"
  428. ACTIVATE WINDOW DGet_date
  429. SET TALK OFF
  430. CLEAR
  431. @5,10 SAY "1st Sample...let's just get a date...any date..."
  432. @6,10 SAY "We do that by saying:"
  433. @7,10 SAY "Dt = GET_Date(DATE())"
  434. WAIT WINDOW
  435. Dt = GET_Date(DATE())
  436. WAIT "You chose: " + DTOC(Dt)+" An Excellent choice!" WINDOW
  437.  
  438. *    Whew! That was tough!  Notice how we called it with the default
  439. *    value equal to today's date.  Clever, huh?  Heck, I thought so.
  440. *    Now, let's do something a little more bizarre.  Let's call it
  441. *    as part of a VALID statement.
  442. CLEAR
  443. @3,5 SAY "Now let's get one as a part of a GET Validation!"
  444. @4,5 SAY "This is a little trickier...we do this by creating"
  445. @5,5 SAY "an additional UDF to do the initial test, which"
  446. @6,5 SAY "in this case is called Wed.  Wed tests the value"
  447. @7,5 SAY "and, if necessary, calls Get_date.  The initial"
  448. @8,5 SAY "Get Statement is:"
  449. @9,5 SAY '@5,15 SAY "..." GET Dt VALID Wed(Dt,"Dt") ERROR ...'
  450. Dt = {01/25/92}
  451. @12,5 SAY "Enter a Date that's a Wednesday " GET Dt ;
  452.     VALID Wed(Dt,"Dt") ERROR "Not a Wednesday, Twit!"
  453. READ
  454. *    Notice how we have the Function Wed actually calling Get_date, as
  455. *    opposed to the VALID statement calling it itself.  That's because
  456. *    Get_date doesn't actually do validation itself, being a shy critter.
  457. *    And yes, I realize you could just say VALID DOW(Dt)=4...lemme alone!
  458. *
  459. WAIT "Boy, was that fun!" WINDOW
  460. RELEASE WINDOW DGet_date
  461. RETURN
  462.  
  463. FUNCTION Wed
  464. PARAMETER Dte, Nam
  465. DO WHILE DOW(Dte) <> 4        &&    Now here we're gonna loop regardless
  466.     Dte = Get_date(Dte)        &&    of the GET...
  467.     IF LASTKEY() = 27        &&    Did they hit escape?
  468.         EXIT                &&    Well, the outta here!
  469.     ENDIF
  470.     IF DOW(Dte) <> 4        &&    They STILL can't get it right!
  471.         WAIT "Still not Wednesday" WINDOW    &&    Let 'em know
  472.     ENDIF
  473. ENDDO                    &&    Loop till Wednesday, Escape or Power Failure
  474. &Nam = Dte                &&    Replace Get variable with new value
  475. SHOW GETS                &&    Show the new value.
  476. RETURN DOW(Dte)=4        &&    Return .T. or .F. as per normal VALID Return
  477.  
  478.  
  479.  
  480. PROCEDURE Ddbfixed
  481. DEFINE WINDOW Ddbfix FROM 5,5 TO 15,75 DOUBLE TITLE "Demo of DbFixed"
  482. ACTIVATE WINDOW Ddbfix 
  483. @1,2 SAY "DbFixed will let you specify a fixed length file with some"
  484. @2,2 SAY "kind of header record (a standard .dbf file would work,"
  485. @3,2 SAY "but it would more likely be a COBOL or other"
  486. @4,2 SAY "non-recognizable kind of file) and help you figure out"
  487. @5,2 SAY "the header and record length by seeing samples of it."
  488. @6,2 SAY "Say, for example, the file People.dbf, which has a header"
  489. @7,2 SAY "length of 290 and a record length of 80."
  490. WAIT
  491. DO Dbfixed
  492. RELEASE WINDOW Ddbfix
  493. RETURN
  494.  
  495. PROCEDURE Dreorg
  496. DEFINE WINDOW Reorg FROM 2,10 TO 15,70 DOUBLE TITLE "Reorg"
  497. ACTIVATE WINDOW Reorg
  498. @3,5 SAY "There's not much to say about Reorg, except in"
  499. @4,5 SAY "passing...by simply running Reorg all open"
  500. @5,5 SAY "database indexes will be recreated."
  501. @6,5 SAY "You need to be careful, though.  Reorg will NOT"
  502. @7,5 SAY "recreate index tags with Relations in them, nor"
  503. @8,5 SAY "indexes using 'UNIQUE' clauses...so be warned!"
  504. WAIT WINDOW
  505. RELEASE WINDOW Reorg
  506. RETURN
  507.  
  508.  
  509. PROCEDURE dStep
  510. PRIVATE X
  511. DEFINE WINDOW Step FROM 1,2 TO 23,70 DOUBLE TITLE "Step"
  512. ACTIVATE WINDOW Step
  513. X=50
  514. @0,5 SAY "This function will let you create arrows to"
  515. @1,5 SAY "Increase or decrease Numeric, Date or Character"
  516. @2,5 SAY "Fields w/out typing in the value"
  517. @4,5 SAY ""        &&    Marker for the Invisible Button #1
  518. @6,5 SAY ""        &&    Marker for the Invisible Button #2
  519. @4,5 GET IncN FUNCTION '*I' SIZE 1,1,1 VALID Step("X","N",45,55,1,.F.) DEFAULT 1 ERROR "Min of 1"
  520. @5,5 GET X VALID BETWEEN(X,45,55) PICTURE "99"
  521. @6,5 GET DecN FUNCTION '*I' SIZE 1,1,1 VALID Step("X","N",45,55,-1,.F.) DEFAULT 1 ERROR "Max of 100"
  522. @ 8,6 SAY "     "        &&    Marker for the Invisible Buttons #3,4,5
  523. @ 9,5 GET Dt DEFAULT DATE()
  524. @10,6 SAY "     "        &&    Marker for the Invisible Buttons #6,7,8
  525. @8, 6 GET IncM FUNCTION '*I' SIZE 1,1,1 VALID Step("Dt","M",{1/1/90},{12/31/94},1,.F.) ;
  526.     DEFAULT 1 ERROR "Min of 1" MESSAGE "Click on me to move 1 Month ahead"
  527. @8, 9 GET IncD FUNCTION '*I' SIZE 1,1,1 VALID Step("Dt","D",{1/1/90},{12/31/94},1,.F.) ;
  528.     DEFAULT 1 ERROR "Min of 1" MESSAGE "Click on me to move 1 Day ahead"
  529. @8,12 GET IncY FUNCTION '*I' SIZE 1,1,1 VALID Step("Dt","Y",{1/1/90},{12/31/94},1,.F.) ;
  530.     DEFAULT 1 ERROR "Min of 1" MESSAGE "Click on me to move 1 Year ahead"
  531. @10, 6 GET DecM FUNCTION '*I' SIZE 1,1,1 VALID Step("Dt","M",{1/1/90},{12/31/94},-1,.F.) ;
  532.     DEFAULT 1 ERROR "Max of 100" MESSAGE "Click on me to move 1 Month back"
  533. @10, 9 GET DecD FUNCTION '*I' SIZE 1,1,1 VALID Step("Dt","D",{1/1/90},{12/31/94},-1,.F.) ;
  534.     DEFAULT 1 ERROR "Max of 100" MESSAGE "Click on me to move 1 Day back"
  535. @10,12 GET DecY FUNCTION '*I' SIZE 1,1,1 VALID Step("Dt","Y",{1/1/90},{12/31/94},-1,.F.) ;
  536.     DEFAULT 1 ERROR "Max of 100" MESSAGE "Click on me to move 1 Year back"
  537.  
  538. @4, 7 SAY "<---This is an invisible button set up using Step"
  539. @5, 9 SAY "<---A standard # get...the trick's in the Inv. Buttons"
  540. @6, 7 SAY "<---This is an invisible button set up using Step"
  541. @12,5 SAY "Tap on the arrows to increase or decrease by"
  542. @13,5 SAY "1...tap <Escape> when sufficiently impressed"
  543. @15,5 SAY "The Invisible Button's GET Statements look like:"
  544. @16,5 SAY '@6,5 GET Dec FUNCTION "*I" SIZE 1,1,1 VALID ;'
  545. @17,5 SAY 'Step("X","N",45,55,-1,.F.) DEFAULT 1'
  546. @18,5 SAY "Where 'X' is the variable contained in the middle GET"
  547. @19,5 SAY "statement"
  548. READ CYCLE
  549. RELEASE WINDOW Step
  550. RETURN
  551.  
  552.  
  553. PROCEDURE DCpack
  554. PRIVATE FVar, PChar
  555. DEFINE WINDOW CPack FROM 2,2 TO 15,60 DOUBLE TITLE "CPack"
  556. ACTIVATE WINDOW CPack
  557. FVar = "Test    "
  558. @0,5 SAY "This function will let you Replace your input,"
  559. @2,5 SAY "Packing it with whatever character you please."
  560. @3,5 SAY "What character would you like to pack with? " GET PChar ;
  561. DEFAULT "0"
  562. @5,5 SAY "Enter something smaller than the field" GET FVar VALID ;
  563.     CPack(Pchar,"",.T.) PICTURE "XXXXXXXXXX"
  564. @7,5 SAY "Tap <Escape> when your excitement level has"
  565. @8,5 SAY "Peaked..."
  566. READ CYCLE
  567. RELEASE WINDOW CPack
  568. RETURN
  569.  
  570. PROCEDURE Reginfo
  571. DEFINE WINDOW Reg FROM 1,5 TO 23,75 DOUBLE
  572. ACTIVATE WINDOW Reg
  573. SET TOPIC TO "REGISTER"
  574. DO WHILE .T.
  575.     CLEAR
  576.     @0,5 SAY "This software is NOT free, but shareware.  This entitles"
  577.     @1,5 SAY "you to use this software to determine it's suitability."
  578.     @2,5 SAY "If you continue to use it, YOU ARE LEGALLY AND MORALLY"
  579.     @3,5 SAY "BOUND TO REGISTER AND MAKE PAYMENT AS DESCRIBED BELOW."
  580.     @4,5 TO 4,65
  581.     @ 5,5 SAY "dbF Software Productions                 CIS #:    72117,165"
  582.     @ 6,5 SAY "PO Box 37194                    Cleve Free-Net:    AE069"
  583.     @ 7,5 SAY "Cleveland, Ohio 44137-0194               Phone:(216)491-4581"
  584.     @ 8,5 TO 8,65
  585.     @ 9,5 SAY "The fee structure is like this:"
  586.     @10,2 SAY "$25              -   Next upgrade, plus next volume of FoxTails"
  587.     @12,2 SAY "All International orders please add $10."
  588.     @14,25 GET Sp PICTURE ;
  589.         "@*RT \<License Request;\<Order Form;\<dbF Info;\<ASP Info;D\<isclaimer;Do\<cumentation;\!\?\<Quit" ;
  590.         MESSAGE "Choose one" DEFAULT 2
  591.     READ CYCLE
  592.     IF Sp = 7 OR LASTKEY()=27
  593.         RELEASE WINDOW Reg
  594.         SET TOPIC TO Vr(_Curobj)
  595.         SHOW GETS
  596.         RETURN
  597.     ENDIF
  598.     CLEAR
  599.     DO CASE
  600.     CASE Sp = 1
  601.         ?
  602.         ?
  603.         ?
  604.         ? " Please feel free to distribute this system in its original format."
  605.         ? " This package cannot be bundled or distributed with any other"
  606.         ? " software or hardware package without prior written permission,"
  607.         ? " except as a shareware system."
  608.         ? " This software is presented on an as-is basis, with no liability or"
  609.         ? " warranty implied or expressed."
  610.         ? " As a somewhat responsible company, dbF Software will attempt to help"
  611.         ? " parties through whatever difficulties they have with FoxTails.  We"
  612.         ? " cannot accept responsibility for any damages caused by the existance"
  613.         ? " of this package.  In cases where appropriate, we would be happy to"
  614.         ? " develop initial databases for a registered client, and then they can"
  615.         ? " take it from there.  dbF Software also can also provide contract"
  616.         ? " programming in any of the xBase flavors.  Contact us for more info."
  617.         ? " Please support the Shareware concept."
  618.         WAIT WINDOW
  619.     CASE Sp = 2
  620.         @8,10 SAY "Do you want a Printout of the Order Form? " ;
  621.         GET M.Prt PICTURE "@*H \<Yes;\<No" SIZE 1,6,2 DEFAULT 1
  622.         READ
  623.         IF Prt = 2
  624.             LOOP
  625.         ENDIF
  626.         Abrt = .F.
  627.         DO WHILE !PRINTSTATUS()
  628.             WAIT "Printer Not ready! Reset or tap any key to abort print" WINDOW NOWAIT
  629.             N=INKEY()
  630.             IF N<>0
  631.                 Abrt = .T.
  632.                 EXIT
  633.             ENDIF
  634.         ENDDO
  635.         WAIT CLEAR
  636.         IF Abrt
  637.             LOOP
  638.         ENDIF
  639.         SET PRINTER ON
  640.         SET CONSOLE OFF
  641.         N=ADIR(A,"foxtails.prg")
  642.         ? "                             FoxTails #1"
  643.         IF N<> 0
  644.             ? DTOC(A[3])+"-"+ALLTRIM(STR(A[2]))
  645.         ENDIF
  646.         ? "                             ORDER FORM "
  647.         ?
  648.         ? "Please Enter the following:                       Today's Date:  __/__/__"
  649.         ?
  650.         ? "Name         : __________________________________________"
  651.         ?
  652.         ? "Address #1   :__________________________________________"
  653.         ?
  654.         ? "Address #2   :__________________________________________"
  655.         ?
  656.         ? "City         :__________________________________________"
  657.         ?
  658.         ? "State/Zip    :__________________________________________"
  659.         ?
  660.         ? "Country      :__________________________________________"
  661.         ?
  662.         ? "Day Phone    :__________________________________________"
  663.         ?
  664.         ? "Eve Phone    :__________________________________________"
  665.         ?
  666.         ?
  667.         ? "What kind of diskette do you want to receive?"
  668.         ?
  669.         ? '  _____ 5 1/4"  _____ 3 1/2"'
  670.         ?
  671.         ? "Where did you find FoxTails?"
  672.         ?
  673.         ? "             :__________________________________________"
  674.         ?
  675.         ? "What improvements would you like to see (use more paper if needed)?"
  676.         ?
  677.         ? ":______________________________________________________________"
  678.         ?
  679.         ? ":______________________________________________________________"
  680.         ?
  681.         ? ":______________________________________________________________"
  682.         ?
  683.         ? "Do you want to be on our mailing list  ___YES   ___NO"
  684.         ?
  685.         ?
  686.         ? "Include:  $25"
  687.         ? "Send Form and Money (please add $10 for international orders) to:"
  688.         ?
  689.         ? "dbF Software Productions          (please make checks payable" 
  690.         ? "PO Box 37194                       to dbF Software)"
  691.         ? "Cleveland, Ohio 44137-0194"
  692.         ?
  693.         ? "Please allow several weeks for delivery."
  694.         SET PRINTER OFF
  695.         SET CONSOLE ON
  696.         EJECT
  697.     
  698.     CASE Sp = 3
  699.         CLEAR
  700.         ? " Glad you asked!  dbF Software Productions is a software"
  701.         ? " company with *you* the end user in mind.  FoxTails #1 is our"
  702.         ? " fourth released product, along with these other shareware"
  703.         ? " systems:"
  704.         ? " SysTrak        A Computer Hardware/Software Inventory System"
  705.         ? " Flags          A Flatfile Application Gen. for db3,4 and Fox"
  706.         ? " ClasAdz        A classified ad/notice system"
  707.         ?
  708.         ? " dbF Software is interested in hearing about ideas of applications"
  709.         ? " you'd like to see.  Those people interested in helping us design"
  710.         ? " the systems would get first crack at them (and vice versa)."
  711.         ? " You're where we get our ideas!  Let us know what you want!"
  712.         ? " Also, each registered dbF user will receive a free copy of"
  713.         ? " another dbF release, along with their registered product."
  714.         @15, 5 SAY "Would you like to learn more about:"
  715.         DO WHILE .T.
  716.             @16,5 GET Sys PICTURE "@*RT \<SysTrak;\<Clas Adz;\<Flags;F\<ox Tails #1;\?\<Quit" ;
  717.             MESSAGE "Choose one" DEFAULT 1
  718.             READ CYCLE
  719.             DO CASE
  720.             CASE Sys = 1
  721.                 DO Dsprpt WITH "Systrak Description Screen", "Systrak.Scr"
  722.             CASE Sys = 2
  723.                 DO Dsprpt WITH "Clas Adz", "Adz.Scr"
  724.             CASE Sys = 3
  725.                 DO Dsprpt WITH "Flags Description Screen", "Flags.Scr"
  726.             CASE Sys = 4
  727.                 DO Dsprpt WITH "FoxTails #1 Description Screen", "FTails.Scr"
  728.             CASE Sys = 5
  729.                 EXIT
  730.             ENDCASE
  731.         ENDDO
  732.     
  733.     CASE Sp = 4
  734.         CLEAR
  735.         ? " This program is produced by a member of the Association of"
  736.         ? " Shareware Professionals (ASP). ASP wants to make sure that"
  737.         ? " the shareware principle works for you. If you are unable to"
  738.         ? " resolve a shareware-related problem with an ASP member by"
  739.         ? " contacting the member directly, ASP may be able to help."
  740.         ? " The ASP Ombudsman can help you resolve a dispute or problem"
  741.         ? " with an ASP member, but does not provide technical support"
  742.         ? " for members' products. Please write to the ASP Ombudsman at"
  743.         ? " 545 Grover Road, Muskegon, MI 49442 or send a CompuServe"
  744.         ? " message via CompuServe Mail to ASP Ombudsman 70007,3536."
  745.         WAIT WINDOW
  746.     
  747.     CASE Sp = 5
  748.         CLEAR
  749.         ? "                      DISCLAIMER OF WARRANTY"
  750.         ?
  751.         ? " THIS SOFTWARE AND MANUAL ARE SOLD 'AS IS' AND WITHOUT WARRANTIES"
  752.         ? " AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES"
  753.         ? " WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE VARIOUS HARDWARE"
  754.         ? " AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE PUT, NO"
  755.         ? " WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED."
  756.         ?
  757.         ? " GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE"
  758.         ? " THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT. "
  759.         ? " THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM.  ANY"
  760.         ? " LIABILITY OF dbF SOFTWARE PRODUCTIONS ITS PRINCIPALS WILL BE"
  761.         ? " LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE"
  762.         ? " PRICE."
  763.         ?
  764.         ? " So there!"
  765.         WAIT WINDOW
  766.  
  767.     CASE Sp = 6
  768.     *    Print out documentation
  769.         CLEAR
  770.         @5,5 SAY "Documentation is included in a file called"
  771.         @6,5 SAY "'FoxTails.Doc', located (on installation,"
  772.          @7,5 SAY "anyway) in "+ALLTRIM(CURDIR())+".  The other file contains"
  773.         @8,5 SAY "information updated in FoxTails too recently"
  774.         @9,5 SAY "to be included in 'FoxTails.DOC', and is called"
  775.         @10,5 SAY "'README.DOC', also located in "+ALLTRIM(CURDIR())+"."
  776.         @12,5 SAY "Which do you want do:"
  777.         @14,5 GET Whch PICTURE "@*RV \<Main Doc;\<Readme Doc;\<Both" DEFAULT 1
  778.         @14,30 GET Scr PICTURE '@*C \<Printer' DEFAULT 1
  779.         @16,30 GET ch FUNCTION '*T \!\<OK;\?\<Cancel' DEFAULT 1
  780.         READ CYCLE
  781.         SET HEADING OFF
  782.         IF Ch = 2
  783.             LOOP
  784.         ENDIF
  785.         IF Whch <> 1        &&    Readme Doc
  786.             DO CASE
  787.             CASE !FILE('README.DOC')
  788.                 WAIT "I can't find the README.DOC file in "+ALLTRIM(CURDIR()) WINDOW
  789.             CASE Scr = 1
  790.                 SET CONSOLE OFF
  791.                 TYPE README.DOC TO PRINT
  792.                 SET CONSOLE ON
  793.                 EJECT
  794.             OTHERWISE
  795.                 DO Dsprpt WITH "Readme File","Readme.Doc"
  796.             ENDCASE
  797.         ENDIF
  798.         IF Whch <> 2        &&    Main Doc
  799.             DO CASE
  800.             CASE !FILE('Foxtails.DOC')
  801.                 WAIT "I can't find the FOXTAILS.DOC file in "+ALLTRIM(CURDIR()) WINDOW
  802.             CASE Scr = 1
  803.                 SET CONSOLE OFF
  804.                 TYPE Foxtails.doc TO PRINT
  805.                 SET CONSOLE ON
  806.                 EJECT
  807.             OTHERWISE
  808.                 DO Dsprpt WITH "Foxtails Doc","FoxTails.Doc"
  809.             ENDCASE
  810.         ENDIF
  811.     ENDCASE
  812. ENDDO
  813. RETURN
  814.