Subject Re: how left() works in dbase 11 plus
From Gaetano D. <gaetanoddRemoveThis@andThatHotmail.com>
Date Tue, 1 Jun 2021 05:59:13 +1000
Newsgroups dbase.getting-started

On 30/05/2021 16:03, AGOSTINHO wrote:
>        if form.entryfield1.value.left(4)

 this line would cause an error: expecting logical value. left() return
a string, not a logical value and "IF" expects a logical expression,
hence this would trigger an error. Also, I note that the function is for
entryfield4_onKey but this line refers to entryfield1, is this intentional?

Left() doesn't work for numeric data type, it return the specified
number of characters from a string (and the string could be a string of
numbers) and if the string is shorter than the specified number of
characters, it returns the complete string of characters.

I see that you have corrected this in a later post by checking if the
value is <9999, so is the issue now solved or do you still have an error?

HTH

--
Gaetano.