jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: infinite loop when using read_mini


Hi again,


The read_mini function will return "" if the user aborted the
read_mini function via, e.g., ^G. However, read_mini also clears the error state, which means that you will not see the UserBreakError error.

I just returned to the code that prompted this question and I don't seem to be getting this behavior. Ie, pressing ^G is generating an UserBreakError exception rather than causing read_mini() to merely return an empty string. Eg:

define test()
{
  variable input;

  do
    {
       try {input = read_mini("type something","","");}

       catch UserBreakError: {message("caught exception!"); return "";}
    }
  while (strlen(input) == 0);

  return input;
}

Pressing ^G at the prompt produces the "caught exception!" message.

Thanks for any clarification

Marv

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]