Subject Re: strange behavior(RESULT) at the command box
From Gaetano D. <gaetanodd@hotmail.com>
Date Sun, 9 May 2021 07:03:30 +1000
Newsgroups dbase.getting-started

On 9/05/2021 6:26, Niall Mulcahy wrote:
> AGOSTINHO Wrote:
>
>> Dear group your assistance for the following:
>>
>> I suspend my program at certain point. and  type the following in the command box I get the following result
>> Why this behivar?
>>
>>
>>
>> ?form.users1.rowset.fields["NAAM"].VALUE
>> AGOSTINHO
>>
>> ?form.users1.rowset.fields["NAAM"].VALUE="AGOSTINHO"
>> false
>   Hi Agostinho
>
> Try
>
> ?  RTRIM(form.users1.rowset.fields["NAAM"].VALUE) = "AGOSTINHO"
>
> Regards
>
> Niall
>
if that fixes the issue, SET EXACT is ON, which is not the usual value
for this setting. It is more flexible to SET EXACT OFF (the default
value in dBase) and use the == operator to assess exact matches when
required. Just my opinion of course.

To visualize any trailing spaces or unexpected characters, you might
want to add delimiters to the output, e.g.

?"|"+form.users1.rowset.fields["NAAM"].VALUE="AGOSTINHO"+"|" or
?"|"+rtrim(form.users1.rowset.fields["NAAM"].VALUE="AGOSTINHO")+"|" or
?"|"+ltrim(rtrim(form.users1.rowset.fields["NAAM"].VALUE="AGOSTINHO"))+"|", just in case there are leading spaces too...
  

Gaetano.