| Subject |
Re: strange behavior(RESULT) at the command box |
| From |
Gaetano D. <gaetanodd@hotmail.com> |
| Date |
Mon, 10 May 2021 07:08:38 +1000 |
| Newsgroups |
dbase.getting-started |
On 10/05/2021 2:27, Akshat Kapoor wrote:
> Good Evening Agostinho, Gaetano, Niall,
>>>> 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
>>>
>
>> 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...
>
> I agree with the suggestions of Gaetano to add some visible characters
> but I do not agree with his suggestion of set exact off (My choice is
> set exact on) as it is damn easy to use = in place of == and the
> result can cause heart burn.
>
> I did check with set exact on the commands I used and the results are
> attached as screenshot.
>
> Set exact is not the culprit there must be some unprintable control
> characters in the string that could be causing the issue.
> I have checked by adding spaces also.
>
> Regards
> Akshat
Well, I learned something new today: I always thought that == and set
exact ON checked for a completely exact match, irrespective of trailing
spaces, but they both ignore trailing spaces. They do however not ignore
leading spaces or trailing tabs.
Gaetano.
|
|