How do I execute a routine within Studio?

128 views
Skip to first unread message

Charlie

unread,
Jun 8, 2022, 2:53:01 PM6/8/22
to IRIS, Caché, Ensemble

Chapter 14 of Using Studio (pdf GSTD), Working with Routines and Include Files, tells you how to create routines within Studio.  Chapter 15, Using the Studio Debugger, tells you how to run routines in debugger mode.

How do I just run a routine?  I searched through “run” and “execute” occurrences and none say how.

Charlie

lverhulst

unread,
Jun 8, 2022, 2:59:13 PM6/8/22
to intersystems...@googlegroups.com
From the terminal:

DO ^routine

where routine is your routine name.
DO can be shortened to just the letter D.

--
Leane Verhulst





--
--
IRIS, Caché, Ensemble
---
You received this message because you are subscribed to the Google Groups "IRIS, Caché, Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/intersystems-public-cache/6f5d75e1-ce9c-480d-b8ce-0c1f8e9bbea0n%40googlegroups.com.

Charlie

unread,
Jun 8, 2022, 3:27:46 PM6/8/22
to IRIS, Caché, Ensemble
I can get to terminal from within Studio?  How?

Charlie

lverhulst

unread,
Jun 8, 2022, 4:07:51 PM6/8/22
to intersystems...@googlegroups.com
No, sorry. Can't get to the Terminal from within Studio. 

Are you running on Windows? Then something like this should be available:
image.png

If you are running on linux/unix, there should be a way to get to the command prompt within a namespace. I just type "cache" on the system I have access to and it puts me in the USER namespace. I can then "D ^%CD" to change to the namespace I need to go to. Type H to exit out.

--
Leane Verhulst





Don Rozwick

unread,
Jun 8, 2022, 4:36:12 PM6/8/22
to intersystems...@googlegroups.com
Not related to terminal

Set Debug Target under Debug menu item
Pick your routine 
Click ok

Then under Debug -> Go

On Wed, Jun 8, 2022 at 2:27 PM Charlie <shyma...@gmail.com> wrote:
--
-Don Rozwick
http://www.linkedin.com/in/donrozwick

He who slings mud generally loses ground.

   Adlai Stevenson

Charlie

unread,
Jun 10, 2022, 3:46:26 PM6/10/22
to IRIS, Caché, Ensemble
That'll do it.  I should'a guessed you could get real close (a few extra text lines output.)

Charlie

Charlie

unread,
Jun 12, 2022, 2:15:54 PM6/12/22
to IRIS, Caché, Ensemble
How do I write a subroutine that returns an array?  I see only QUIT SINGLEVALUE

Charlie

Ed Clark

unread,
Jun 13, 2022, 10:33:45 AM6/13/22
to intersystems...@googlegroups.com
Depending on context, you can:
return a $list
use a global, process-private global, or percent variable
return the array in a parameter passed by reference
 return an object, which could have multidimensional properties:

 s rtnlist=$$makearray(.o)
 zw o,rtnlist,%passvar,^||passglob
 q
 
makearray(arr) {
    s arr=1
    s arr(1,1)=1
    s lst=$lb(1,2,3)
    s %passvar="abc",%passvar("sub")=2
    s ^||passglob="def"
    q lst
}



Reply all
Reply to author
Forward
0 new messages