Sure you can. The syntax is: DO ^routinename or DO ^routinename(args…)
MVBasic programs are compiled into Caché routines. If you don’t specify the name, the system generates one. An easy way to find the generated name is to CATALOG the program and look at the VOC entry.
Here is a sample TCL session.
MV:ED BP MYSUB
MYSUB
New record.
----:I
0001= SUBROUTINE MYSUB(ARG)
0002= CRT "IN MYSUB"
0003= CRT "ARG IS: ":ARG
0004= RETURN
0005=
Bottom at line 4.
----:FIBC
"MYSUB" filed in file "BP".
MYSUB
[B0] Compilation completed.
[243] 'MYSUB' Cataloged Local.
MV:CT VOC MYSUB
MYSUB
0001 V
0002 MVB.15ýMV
0003 B
0004
0005
0006
0007 L
0008 MYSUB
0009 BP
0010 MV
MV:
MV:[D ^MVB.15("RED")
IN MYSUB
ARG IS: RED
MV:
Life i
Life is simpler if you use #PRAGMA to specify your routine name.
MV:ED BP MYSUB
MYSUB
4 lines long.
----:I #PRAGMA ROUTINENAME=MYSUB
0001: #PRAGMA ROUTINENAME=MYSUB
----:FIBC
"MYSUB" filed in file "BP".
MYSUB
[B0] Compilation completed.
[243] 'MYSUB' Cataloged Local.
MV:CT VOC MYSUB
MYSUB
0001 V
0002 MYSUBýMV
0003 B
0004
0005
0006
0007 L
0008 MYSUB
0009 BP
0010 MV
MV:
MV:[D ^MYSUB("GREEN")
IN MYSUB
ARG IS: GREEN
MV:
Note that the program need not be CATALOGed in order for COS to execute it.
/Michael
--