home *** CD-ROM | disk | FTP | other *** search
/ Pro-motion 2 / PM02-Disk1.iso / mac / Parts / Main.dir / Script_2_CustumHandres1.ls < prev    next >
Encoding:
Text File  |  2001-01-31  |  1.6 KB  |  81 lines

  1. global f, ff, s, ss, m, mm, sozaipath, d, filenamelist, endtime, nowtime, nowrate, prevrect, activsam, activsp, activpage
  2.  
  3. on setsamname
  4.   repeat with i = 1 to 18
  5.     n = (activpage * 18) + i
  6.     if n > 111 then
  7.       set the member of sprite (i + 30) to member("Dummy")
  8.       next repeat
  9.     end if
  10.     sam = n + 10
  11.     set the member of sprite (i + 30) to member(sam, "Sam")
  12.   end repeat
  13. end
  14.  
  15. on pluszero val, k
  16.   sa = 0
  17.   zeros = EMPTY
  18.   returnval = EMPTY
  19.   val = string(val)
  20.   sa = k - the number of chars in val
  21.   if sa <= 0 then
  22.     return val
  23.     exit
  24.   end if
  25.   repeat with i = 1 to sa
  26.     put "0" after sa
  27.   end repeat
  28.   returnval = zeros & val
  29.   return returnval
  30. end
  31.  
  32. on activmarker
  33.   lc = the number of lines in the labelList
  34.   repeat with i = 1 to lc
  35.     if the frame < label(line i of the labelList) then
  36.       return line i - 1 of the labelList
  37.     end if
  38.   end repeat
  39.   return line lc - 1 of the labelList
  40. end
  41.  
  42. on dsize byte
  43.   bytet = EMPTY
  44.   if byte < 1024 then
  45.     bytet = string(float(byte)) && "Byte"
  46.   else
  47.     if byte < 1048576 = 1 then
  48.       bytet = string(float(byte) / 1024) && "KB"
  49.     else
  50.       if byte < 1073741824 then
  51.         bytet = string(float(byte) / 1048576) && "MB"
  52.       else
  53.         bytet = string(float(byte) / 1073741824) && "GB"
  54.       end if
  55.     end if
  56.   end if
  57.   return bytet
  58. end
  59.  
  60. on msf t
  61.   m = t / 3600
  62.   s = t mod 3600 / 60
  63.   f = t mod 60 / 2
  64.   if m < 10 then
  65.     mm = "0" & string(m)
  66.   else
  67.     mm = string(m)
  68.   end if
  69.   if s < 10 then
  70.     ss = "0" & string(s)
  71.   else
  72.     ss = string(s)
  73.   end if
  74.   if f < 10 then
  75.     ff = "0" & string(f)
  76.   else
  77.     ff = string(f)
  78.   end if
  79.   return mm & ":" & ss & ":" & ff
  80. end
  81.