home *** CD-ROM | disk | FTP | other *** search
/ PowerPlay 1997 March / PowerPlay0397.iso / T-ONLINE / SHOW / XTRAS / FFXTRAS / -FFBENCH.DIR / 00003_Script_3 < prev    next >
Text File  |  1996-03-15  |  4KB  |  130 lines

  1. on closeWindow
  2.   put the windowList into theList
  3.   repeat with i = 1 to count(theList)
  4.     put string(getAt(theList,i)) into theItem
  5.     delete word 1 of theItem
  6.     delete char 1 of theItem
  7.     put the number of chars of theItem into theChar
  8.     delete char theChar-1 to theChar of theItem
  9.     if (theItem contains "Test Bench") or (theItem contains "FFBENCH") then
  10.       forget window theItem
  11.     end if
  12.   end repeat
  13.   tell the stage to puppetPalette 0
  14.   tell the stage to updateStage
  15. end closeWindow
  16.  
  17. on listTitles
  18.   put dbCount() into theNum
  19.   repeat with i = 1 to theNum
  20.     put dbGo(i) into theResult
  21.     put fileflex(26,"TITLE")
  22.   end repeat
  23. end listTitles
  24.  
  25. on buildHelpTextList
  26.   put empty into field "helptextlist"
  27.   put empty into theList
  28.   put 0 into frameRef
  29.   put 1 into textLine
  30.   put field "helptext" into theText
  31.   repeat while 1 = 1
  32.     if char 1 of line textLine of theText = "*" then
  33.       put frameRef + 1 into frameRef
  34.       if theList = "" then
  35.         put frameRef & "," & textLine into theList
  36.       else
  37.         put return & frameRef & "," & textLine after theList
  38.       end if
  39.       put textLine + 1 into textLine
  40.     else
  41.       if textLine = the number of lines of theText then exit repeat
  42.       put textLine + 1 into textLine
  43.     end if
  44.   end repeat
  45.   put theList into field "helpTextList"
  46.   put "Help Text List construction completed."
  47. end buildHelpTextList
  48.  
  49. on showHelpText theF
  50.   put line theF of field "helpTitleList" into field "Help Title"
  51.   put 0 into foundF
  52.   repeat with i = 1 to the number of lines of field "HelpTextList"
  53.     put item 1 of line i of field "helptextlist" into theFrameP
  54.     if theFrameP = theF then 
  55.       put i into foundF
  56.       exit repeat
  57.     end if
  58.   end repeat
  59.   if foundF > 0 then
  60.     put item 2 of line foundF of field "helpTextList" into startLine
  61.     if foundF < the number of lines of field "helpTextList" then
  62.       put item 2 of line (foundF + 1) of field "helpTextList" - 1 into endLine
  63.     else
  64.       put the number of lines of field "helpText" into endLine
  65.     end if
  66.     put line integer(startLine) to integer(endLine) of field "helpText" into theText
  67.     delete char 1 of theText
  68.     put theText into field "help field"
  69.   end if
  70. end showHelpText
  71.  
  72. on getTheRecord
  73.   put dbGetCurrRecVal("L") into field "dbData"
  74.   if dbRecordDeleted(string(dbCurrRecNum())) = "Y" then
  75.     put "DELETED" into field "deleted"
  76.   else
  77.     put empty into field "deleted"
  78.   end if
  79. end getTheRecord
  80.  
  81. on getTheRecord2
  82.   put DBGetCurrRecVal("L") into theRec
  83.   -- parse record into the fields
  84.   delete line 1 of theRec
  85.   delete line 1 of theRec -- crude, but hey, it's 6AM!
  86.   repeat with i = 1 to 16
  87.     if i <= the number of lines of theRec then 
  88.       put line i of theRec into theLine
  89.       if item 2 of theLine = "M" then
  90.         put "[memo]" into field ("f" & i)
  91.       else
  92.         delete item 1 to 2 of theLine
  93.         put theLine into field ("f" & i)
  94.       end if
  95.     end if
  96.     -- field cleanup
  97.     --    if the number of chars of field ("f" & i) < 2 then
  98.     --      put field ("f" & i) & "  " into field ("f" & i) -- force the size for Director
  99.     --    end if
  100.     --    set the backColor of cast ("f" & i) to 0
  101.     --    set the foreColor of cast ("f" & i) to 255
  102.     --    set the textSize of field ("f" & i) to 9  
  103.     --    put the number of chars of field ("f" & i) into cnt
  104.     --    delete char cnt-1 to cnt of field ("f" & i)
  105.   end repeat
  106. end getTheRecord2
  107.  
  108. on getTheRecordG
  109.   --put DBGetCurrRecVal("G") into dbResult
  110.   repeat with i = 1 to 16
  111.     if field ("n" & i) <> "[not used]" then
  112.       put "put " & field ("n" & i) & " into field " & quote & "f" & quote & " & i)" into theCmd
  113.       put theCmd
  114.     end if
  115.   end repeat
  116. end getTheRecordG
  117.  
  118.  
  119. on processFname f
  120.   put DBListFields() into theList
  121.   delete line 1 of theList
  122.   put f into fNum
  123.   delete char 1 of fNum
  124.   put line integer(fNum) of theList into theLine
  125.   if item 2 of theLine <> "N" then
  126.     alert "Can't sum or average a non-numeric field."
  127.   else
  128.     alert "Sum: " & DBSum(field f) & ", Average: " & DBAverage(field f) 
  129.   end if
  130. end processFname