> I just figured out that print() and write() can be called from
> Project Data file or any evaluate slot and send their output
Print() is just the tip of the iceberg. You have all of NS available to you
at build-time (that's not all the fns in the Newton ROM). Not too many
people seem to take advantage of this fact.
E.g. you can define global fn's at build-time to help improve your code.
//in project data
global MyMakeRect(t,l,b,r)
begin
if b<t OR r<l then Throw('|evt.ex.msg|, "you knucklehead");
local wid := r-l;
local hgt := b-t;
{
bounds: SetBounds(l,t,r,b),
width: wid,
height: hgt,
area: wid*hgt,
perim: 2*(wid+hgt),
}
end;
Then you can use MyMakeRect in evaluate slots to initialize them to these
"useful" frames.
Note that MyMakeRect won't be available at run-time unless you include it
in your package (e.g. put it in a slot in your base view and invoke it via
message sending or use DefConst and call)
Take a look at the NTKDefinitions file to see some of the build-time
functions NTK provides (like SetBounds) - and get ideas of what kind of
things you can write.
-ME