Discussion (4)0
Log in or sign up to continue

Or if you want to display or get that value with a single line of code (assuming you do not care about error handling), then you could do the following:

Write ##class(%Routine).%OpenId("hello.mac").SizeGet()

If you want the sizes of a lot of routines the Studio open dialog query is very handy and you can sort by the routine size too. There is also a routine specific query in %Routine class to, but if you need to see classes, or CSP pages etc then the open dialog query is the best:

d ##class(%ResultSet).RunQuery("%RoutineMgr","StudioOpenDialog","*.*",,,,1)

Also, you can use the built-in %RD routine.  After you enter the routine name or names that you want to see the sizes for, then answer "L" for Long Form at the next prompt.   that will display additional attributes about the specified routines - one of which will be the size in bytes.

Example Output:

                 Long Listing of Selected Routine/Include Files
                              Namespace:  TEST
                         22 Aug 2016  6:14 PM   Page 1

NAME                            .EXT.VER  LANG  DATE/TIME             #BYTES

UTTest                          .MAC            20 May 2016  10:21 am  14252