Skip to main content

Do Command

In ObjectScript, programs are called routines. You use Do to execute routines; system routines that Caché provides as well as routines you've written yourself. To demonstrate this command, let's look at the system routine that displays database free space, %FREECNT. You can run it by using Do, making sure to place the caret “^” character before the name of the routine. Note that routines that start with the % character are Caché system routines. In the example below, %FREECNT displays the freespace in the SAMPLES database.

In addition, you can run procedures within a routine by referring to the label of the line (also called a tag) where the procedure begins within the routine. You place the label right before the caret. In the example, the ALL procedure of %FREECNT displays the free space for all databases.

Routine names and labels are case-sensitive.

SAMPLES>do ^%FREECNT

Databases Selected
------------------
c:\intersystems\cache\mgr\samples\
Device: 
Right margin: 80 => 

                           Cache Database Free Space
                              Feb 25 2011  1:01 PM
Database                           Max Size  Size    Available %Free   Disk Free
c:\intersystems\cache\mgr\samples\ Unlimited 31MB    4.1MB     14.12   133.67GB

SAMPLES>do ALL^%FREECNT                                                                    

Databases Selected
------------------
c:\intersystems\cache\mgr\
c:\intersystems\cache\mgr\cache\
c:\intersystems\cache\mgr\cacheaudit\
c:\intersystems\cache\mgr\cachelib\
c:\intersystems\cache\mgr\cachetemp\
c:\intersystems\cache\mgr\docbook\
c:\intersystems\cache\mgr\samples\
c:\intersystems\cache\mgr\user\
Device: 
Right margin: 80 => 

                           Cache Database Free Space
                              Feb 25 2011  1:01 PM
Database                           Max Size  Size    Available %Free   Disk Free
c:\intersystems\cache\mgr\         Unlimited 36MB    0.59MB    1.63    133.57GB
c:\intersystems\cache\mgr\cache\   Unlimited 11MB    10MB      90.9    133.57GB
c:\intersystems\cache\mgr\cacheaudit\
                                   Unlimited 11MB    9.8MB     89.09   133.57GB
c:\intersystems\cache\mgr\cachelib\
                                   Unlimited 217MB   18MB      8.29    133.57GB
c:\intersystems\cache\mgr\cachetemp\
                                   Unlimited 21MB    19MB      90.47   133.57GB
c:\intersystems\cache\mgr\docbook\ Unlimited 114MB   0.80MB    .7      133.57GB
c:\intersystems\cache\mgr\samples\ Unlimited 31MB    4.1MB     14.12   133.57GB
c:\intersystems\cache\mgr\user\    Unlimited 21MB    7.3MB     34.76   133.57GB

SAMPLES>

FeedbackOpens in a new tab