home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Magazin 1997 March / Image.iso / wd.dxr / Name_11_NameOK.ls < prev    next >
Encoding:
Text File  |  1996-10-28  |  1023 b   |  30 lines

  1. on mouseUp
  2.   global gActivePlayers, gPlayers, gPlayerNumber
  3.   repeat while char 1 of field "NameField" = " "
  4.     put EMPTY into char 1 of field "NameField"
  5.   end repeat
  6.   repeat while char length(field "NameField") of field "NameField" = " "
  7.     put EMPTY into char length(field "NameField") of field "NameField"
  8.   end repeat
  9.   if field "NameField" = EMPTY then
  10.     return 
  11.   end if
  12.   set gPlayerNumber to 0
  13.   repeat with i = 1 to count(gPlayers)
  14.     if the text of member "NameField" = getAt(getAt(gPlayers, i), 1) then
  15.       set gPlayerNumber to i
  16.     end if
  17.   end repeat
  18.   if gPlayerNumber = 0 then
  19.     setaProp(gPlayers, field "NameField", [field "NameField", 1, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY])
  20.   end if
  21.   set gPlayerNumber to 0
  22.   repeat with i = 1 to count(gPlayers)
  23.     if the text of member "NameField" = getAt(getAt(gPlayers, i), 1) then
  24.       set gPlayerNumber to i
  25.     end if
  26.   end repeat
  27.   playsound(1, "Ok", 1)
  28.   go("NameOK")
  29. end
  30.