Troubleshooting

You choose an item from the New menu and the Newton throws an exception "Expected an array, frame, or binary object, got integer"

The problem is almost certainly that your FillNewEntry method isn't returning a frame. When the user chooses New, the CreateBlankEntry message is sent to the newtSoup, then the return result from that is sent to FillNewEntry to add further slots. The return result of FillNewEntry then becomes the new soup entry. A common error is to fill in slots in the incoming frame parameter, but then to fail to return that as your function result. Here's a bad FillNewEntry:

func(e)
begin
   e.name := "Sally";
   e.age := Random(1, 40);
end
It needs to be rewritten as a good FillNewEntry to return e:

func(e)
begin
   e.name := "Sally";
   e.age := Random(1, 40);
   return e;
end

An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996