[comp.sys.mac.hypercard] HELP with ScanToXxx HC glue routines!!

er225711@unix.cis.pitt.edu (Martin NMN Thurn) (07/27/90)

  I'm having trouble with the HC callback routines ScanToXxx, etc.  
In particular, I am trying to put the "lines" of a HC variable into an 
array of str255's.  Here is the hunk of code in question:

Hlock(paramptr^.params[2]);
Aend := paramptr^.params[2]^;
scanToZero(paramptr, Aend);     (* Aend now points to end of string (?)  *)
Aptr := paramptr^.params[2]^;
numAnswers := 0;
repeat
  numAnswers := numAnswers + 1;
  ReturnToPas(paramptr, Aptr, Answer[numAnswers]);
  ScanToReturn(paramptr, Aptr);
until  (longint(Aptr) >= longint(Aend));         (* never happens!!  *)
Hunlock(paramptr^.params[2]);

This results in an infinite loop, i.e. Aptr never gets advanced to Aend.  
What it looks like is that ScanToReturn goes nowhere if the pointer is
already on a #13.  Gary Bond's examples are buggier than an Amazon picnic,
does anybody know how to use these procedures?
Thank you for your advice in advance.
--Martin Thurn          thurn@lcl.cmu.edu
"I can never remember if my .signature is appended automatically"
-- 
---Martin Thurn          thurn@lcl.cmu.edu

"Wow!  Someone at CMU who doesn't have a bunch of
  numbers and plus signs in their name!"