>
> On May 03, 2007, at 20:43 UTC, [EMAIL PROTECTED] wrote:
>
> > for c = 0 to len(self.BookcodeField.text)
> > if InStr(LegalCharacters, mid(self.BookcodeField.text, c, 1)) =
> > 0 then
> > return ErrorMsgBox("The Bookcode field contains an illegal
> > character.")
> > end if
> > next
>
> That "c" should start at 1, not at 0.
>
> Also note that every iteration through this loop, you are having the
> EditField convert its entire contents into a String... twice! That's a
> very expensive (and in this case, wasteful) thing to do. You should
> stick BookcodeField.text into a local variable, and just operate on
> that local variable inside the loop.
>
> Best,
> - Joe
>
> --
> Joe Strout -- [EMAIL PROTECTED]
> Strout Custom Solutions
See? I knew it was me. It works great now. Thanks! And thanks for pointing out
the loop issue. To be honest, I'm in such a hurry to get this project done, I
totally blew past that and I normally do my best to catch little things like
that. Luckily for me, the total length of the text is limited to 255 characters.
Thanks
--
Philip Regan
[EMAIL PROTECTED]
RB2K7r2, Mac OS 10.4.9, PowerPC G5
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>