MetaCard limits

Tariel Gogoberidze PMDA at earthlink.net
Wed Jul 3 01:26:01 EDT 2002


Mac OS 9.1. MC v 2.4.2

It seems that MC functions

average ()
stdDev ()
min ()
Max ()

Are limited to number of items they can process. Not sure about exact
number (uint2 = 65,535 bytes?) but it breaks somewhere after 65000 items

Below is the example to illustrate

on mouseup
  repeat 100000
    put random (21) &"," after tCKfunction
  end repeat
  delete char -1 of tCKfunction
  answer "sum = "& sum (tCKfunction)&cr&"StdDev = "& stdDev
(tCKfunction)&cr&"ave = " & average (tCKfunction)
  put number of items of tCKfunction into N
  put 0 into countSumOFSqrs
  put 0 into tcount
  repeat for each item i in tCKfunction
    add i^2 to countSumOFSqrs
    add i to tcount
  end repeat
  put sqrt ((countSumOFSqrs-(((sum (tCKfunction))^2)/N))/(n-1)) into tDev
  answer "sum = "&tcount&cr&"stdDev = "&tDev&cr&"ave = "& tcount / N
end mouseup

Also, it seems that maximum allowable value for the tabstops in field is
32767 and there are anomalies in field behavior if the height/width of
the field is greater then 32767 pixels (I once tried to use such field
inside the group control with vertical scrollbar)

Anyway this limitations are not mentioned in MetaTalk reference stack
under "limits" and I thought this observations will be in some use for
someone who deals with large amounts of data in their scripts.

Unfortunately, MC is not returning  error messages like "limit exceeded"
in such cases, just the wrong number - and I had a hard time debugging
it in relatively complex handler.


Best regards
Tariel Gogoberidze

P.S. On the positive  site ;-) sum () function seems to be working with
any number of items (I tested for up to 500 000 items)



More information about the metacard mailing list