検索

記事
· 2016年5月17日 3m read

NewBie's Corner Session 3 More Read and Write commands & Multiple commands

NewBie's Corner Session 3 More Read and Write commands & Multiple commands

Welcome to NewBie's Corner, a weekly or biweekly post covering basic Caché Material.

Click on the Caché Cube in your system tray and select Terminal to try out the commands.

Write command with carriage return and line feed

When the exclamation point "!" is inserted after a Write command, a carriage return and line feed combination is produced. Note in this example, that a comma separates the exclamation point from the variable "X".

Set X=12
Write !,X
                                                ; carriage return and line feed inserted here
12

Multiple variables may be set with one Set command and the Write command does the same

Set X=12,Y=13,Z=14         ;single Set command with variables separated by commas
Write X,Y,Z                          ;single Write command with multiple variables
121314

Now here is where the carriage return and line feed come in

Write !,X,!,Y,!,Z
12
13
14

Other Read and Write operators

Exclamation point (!) – Inserts a carriage return / line feed (already shown)

Hash symbol (#)

        The Hash symbol or pound sign (#) serves two purposes:

                Write # - inserts a formfeed

                             Write #,"Just after a formfeed" 

Read – limits the number of characters' read

                Read entry#5    ; will accept the first 5 characters only

                Integer required

Question mark (?) - Write advancing a number of spaces from the beginning of the line

                               Write ?10,"Now is the time"   ;   will start writing at column 10

                Integer required

Colon (:) - Read command timer

                Read entry:5    ; will only wait 5 seconds before terminating read

Integer required


--Mike Kadow

PaulMikeKadow@gmail.com

If you have a comment, please respond through the InterSystems Developer Community, don't send me private email. Unless of course you wish to address me only.

See NewBie Index for an index of all NewBie Corner posts.

1 Comment
ディスカッション (1)0
続けるにはログインするか新規登録を行ってください
質問
· 2016年5月16日

Roman Number Converter

Hi, 
My name is Sergio Fernandes and I'm from Brazil.
I would like to know how can i use MVBasic at Cache Terminal or .csp.
My original problem is to converter Integer Numbers to Roman Numbers and consulting cache documentation I found "Conversion Codes" at http://localhost:57772/csp/docbook/DocBook.UI.Page.cls?KEY=GVRF_basicfea...
My version is Intersystems Ensemble 2013.1.6.950.0
Thanks a lot,

Sérgio Fernandes

3 Comments
ディスカッション (3)0
続けるにはログインするか新規登録を行ってください
質問
· 2016年5月13日

What server does Atelier expect to connect to?

Hello,

I'm trying to connect to a Caché server from Atelier; the Caché server is 2015.x.

The address and port I'm trying to connect to is the SQL gateway server; and I get, each time, an "unexpected end of file from server".

Note that unfortunately, for the moment, I connect as _system... And the Caché install has the default privileges.

What am I doing wrong?

1 Comment
ディスカッション (1)0
続けるにはログインするか新規登録を行ってください
記事
· 2016年5月11日 1m read

ZZPRINT a handy way to view routine lines from the command line

Often when debugging COS code you get an error message such as '<UNDEFINED>test^routine *test' so the first thing you want to do is to take a look at this code and see what it is doing. From the command line you can:

ZLOAD routine ZPRINT test

Which means splitting the $zerror information into the routine name and the line and adding the zload/zprint commands. Also you often want to view the lines above the one where the error happened as this gives you some context of how you got to this line, using ZPRINT you could 'ZPRINT +1:test' but that may display hundreds of lines.

Since 2013.1 you can use ZZPRINT as follows:

ZZPRINT "test^routine":10

Which will print the 10 lines before the 'test^routine' line, so here you can cut/paste the line reference directly into the command and you can specify the number of lines before or after using this syntax where both the before or after can be blank:

ZZPRINT "<entry+offset^routine>":<before lines>:<after lines>

Also since 2015.2 you can display the current $zerror line with and the ten lines before with:

ZZPRINT "$ze":10

Also if you are in the command line debugger then you can display the current break point location with:

ZZPRINT "*":5:5

Will display the current location and 5 lines previous and 5 lines after.

6 Comments
ディスカッション (6)2
続けるにはログインするか新規登録を行ってください
質問
· 2016年5月9日

Production Monitor

At the Global Summit several folks had mention that they developed their own production monitor. I am looking to create a monitor similar to eGate that we only display those Services/Processes/Operations that are in trouble, and those Errors that are showing up in the Event Log. Does anyone have any examples of this?

Thanks

Scott Roth

The Ohio State University Wexner Medical Center

3 Comments
ディスカッション (3)1
続けるにはログインするか新規登録を行ってください