home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 - Expo 2000 / Image.iso / t-online / show / xtras / ffxtras / -ffdesig.dir / 00005_createButtonHandler.ls < prev    next >
Encoding:
Text File  |  1996-03-15  |  1.2 KB  |  54 lines

  1. on doCreateOK
  2.   global fieldSpec
  3.   if the optionDown then
  4.     set doAgain to 1
  5.   else
  6.     set doAgain to 0
  7.   end if
  8.   if (field "FieldEntry" = EMPTY) or (field "FieldEntry" = "_") then
  9.     beep()
  10.   else
  11.     set theType to item 2 of fieldSpec
  12.     set theField to field "FieldEntry"
  13.     set theNum to the number of chars in theField
  14.     delete char theNum of theField
  15.     repeat with i = 1 to the number of lines in field "masterNameList"
  16.       if line i of field "MasterNameList" = theField then
  17.         beep()
  18.         exit
  19.       end if
  20.     end repeat
  21.     put theField into item 1 of fieldSpec
  22.     hideDefineField()
  23.     putFieldInfo()
  24.     if doAgain then
  25.       put EMPTY into item 1 of fieldSpec
  26.       case theType of
  27.         "C":
  28.           set panel to "text"
  29.         "N":
  30.           set panel to "numeric"
  31.         "D":
  32.           set panel to "date"
  33.         "L":
  34.           set panel to "boolean"
  35.         "M":
  36.           set panel to "memo"
  37.       end case
  38.       showDefineField(panel)
  39.     end if
  40.   end if
  41. end
  42.  
  43. on doCreateCancel
  44.   global fieldSpec
  45.   set fieldSpec to EMPTY
  46.   hideDefineField()
  47. end
  48.  
  49. on showSpriteLoc
  50.   repeat with i = 1 to 48
  51.     put i & ":" && the loc of sprite i
  52.   end repeat
  53. end
  54.