From | MORTEN CHRISTENSEN
/---------------------------------------
> I want the macro to stop, if a Find-command is not successful,
> and to continue, if the find is successful. I expect it to be
> determined by the return of non-zero or zero / true or false, but
> I cannot see, how to test the return-value.
\---------------------------------------
To | ALL
Hi Morten,
One of the big differences between TSE Pro. and TSe Jr. (formerly
QEdit), is that you can test the results of a command directly in TSE
Pro. And, you can also stop a macro in the middle, instead of having to
jump to the end of the macro... So, let's take your example:
/-------------------
> It looks like, at some times it works with a:
> lFind('[~\t]','x+b')
> if True
> goto label_end
> endif
\-------------------
TRUE in this case is a _constant_ value. Your current IF statement is
like saying:
if 5
// ... rest of code here ...
endif
Which will _always_ be TRUE.
What you want to do is test the result of the lFind() operation:
if lFind('[~\t]','x+b')
// ... rest of code here ...
endif
I hope this helps, Morten. If you have any more questions, please feel
free to ask!
George J. De Bruin
SemWare Technical Support
-- SPEED 2.0h #10: TSE Jr, MEM-RES, OS/2 & The SemWare Editor Professional
--- FidoPCB v1.4 [ff151/a]
---------------
* Origin: SemWare Support BBS * 404-641-8968 * (1:133/314)
|