TIP: Click on subject to list as thread! ANSI
echo: qedit
to: MORTEN CHRISTENSEN
from: MIKE CHAMBERS
date: 1995-05-29 02:34:00
subject: TSE/pro macro

Hi Morten:
MC>I have just started making macroes in TSE pro 2 and cannot find the 
commands,
MC>which do, what I have done with jTrue and jFalse in QEdit3.
MC>I want the macro to stop, if a Find-command is not successful, and to 
continu
MC>if the find is successful. I expect it to be determined by the return of
MC>non-zero or zero / true or false, but I cannot see, how to test the
MC>return-value.
MC>It looks like, at some times it works with a:
MC>  lFind('[~\t]','x+b')
MC>   if True
MC>     goto label_end
MC>   endif
MC>but it doesn't work when the question is "if False".
MC>It should be simple, but not for me at the moment.
The syntax between Qedit and TSE macros is markedly different in a number of
respects including the one above.  The lfind is a boolean function procedure
returning a true value if the target is found and a false otherwise.  Thus
the implementation should be:
  if lFind('[~\t]','x+b')
     //do whatever you should when true
  else
     //do whatever you should when false
  endif
MC>but it doesn't work when the question is "if False".
MC>It should be simple, but not for me at the moment.
It will be soon.  TRUE and FALSE are constants in SAL, not condition
registers.  The statement
       if TRUE
will always evaluate TRUE.  Likewise, the statement
       if FALSE
will always evaluate false.  They are not linked in any way with the
result of the lfind.
Suggestion 1:  Read through some macro examples built into TSE.  For
               example, the  ..\ui\tse.ui file has many short procedures
               which perform very specific functions.  Edit the file
               with TSE and use the 'Function List' feature  to
               choose an interesting function to read.
Suggestion 2:  If you've programmed in Pascal, Modula, PL/I or some
               other literate, procedural language, it will probably be
               helpful to think about macro coding more in those terms
               than in Qedit terms.
Suggestion 3:  If you think you need to use a goto, you're not using all
               of the language.
Good luck!
Mike.
---
 þ SLMR 2.1a þ What has four legs and an arm?   Ans.-- A happy Pit Bull
--- FidoPCB v1.4 [ff151/a]
---------------
* Origin: SemWare Support BBS * 404-641-8968 * (1:133/314)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.