To search mask in the global ?

To search mask in the global ?

Post by va » Thu, 24 Dec 2009 22:33:34


Hello Everyone!
How can the value of team ZWRITE receive variable ?
It would help in searching for the Global mask (eg ZWR ^ Gl (,,
data)). . .

Thanks.
 
 
 

To search mask in the global ?

Post by va » Thu, 24 Dec 2009 22:41:13


I am happy with the search for the mask, although it would be good
work of this team and so ZWR ^Gl(1,,,) to get all the nodes in which
the first place 1

Thanks

 
 
 

To search mask in the global ?

Post by Mike » Fri, 25 Dec 2009 00:20:38


>Thanks

D ^%G

Global: ^GI(1

This will give you what you want in most flavors of mumps.

Mike
 
 
 

To search mask in the global ?

Post by va » Fri, 25 Dec 2009 15:17:58


I agree with you that it works in the Cache and MSM.
And in the GTM is not working well
Here's an example:

GTM>d ^%G

Output device: <terminal>:

List ^T(1

%GTM-E-COMMA, Comma expected in this context

List ^T(1,

%GTM-E-EXPR, Expression expected but not found

List ^T(,2,3

%GTM-E-COMMA, Comma expected in this context

List ^T(,,3

%GTM-E-COMMA, Comma expected in this context

List ^T(,2,3)
^T(1,2,3)="Test Nr.2"
^T(2,2,3)="Test Nr.2"
^T(3,2,3)="Test Nr.2"

List ^T(,,3)
^T(1,2,3)="Test Nr.2"
^T(2,2,3)="Test Nr.2"
^T(3,2,3)="Test Nr.2"
List ^


This is why the value ZWR want to get into a variable, and the rest to
refine.
I need it for the graphic editor of Global GTM in the Windows
environment.
 
 
 

To search mask in the global ?

Post by K.S. Bhask » Sun, 27 Dec 2009 03:45:04

Here is an example of using patterns in ZWRITE for GT.M - it is more
powerful than ^%GO, if you use patterns and ranges. For example:

GTM>Set ^X(1)="abc",^X(2)="cde",^Y(1)="pqr",^Y(2)="stu"

GTM>ZWR ^?1A(1)
^X(1)="abc"
^Y(1)="pqr"

GTM>ZWR ^?1A(1.5:2.5)
^X(2)="cde"
^Y(2)="stu"

GTM>

Regards
-- Bhaskar
 
 
 

To search mask in the global ?

Post by va » Sun, 27 Dec 2009 15:45:06


Thank you.
And how did everything get all this in a variable (array) to transfer
it to a remote user API ?
Type:

ZWR ^?1A(1)
^X(1)="abc"
^Y(1)="pqr"


(1)='^X(1)="abc"'
(2)='^Y(1)="abc"'
........
Array(n)= ...

Agree that this can be achieved by writing your own code more
complicated
but this approach would be better for me using ZWRITE ...

Return(mask,Array)
???? ZWR mask ????
For i=1:1 Set ?? Quit:??="" Do
. Set Array(i)=??
Quit

I can not be very correct to express in English, on the subject but
the essence of this.
Thank.
Valeriu. Chisinau, Moldova of Republic.
 
 
 

To search mask in the global ?

Post by K.S. Bhask » Sun, 27 Dec 2009 23:45:27

Although the output of ZWRITE cannot be directed to a local variable,
it goes to the current IO device, which can be a file - or a pipe.

GTM>Set file="/tmp/ZWRITE"_$Job_".txt"

GTM>Open file

GTM>Use file

GTM>ZWRite ^?1A(1)

GTM>Use $Principal

GTM>ZSYstem "cat "_file
^X(1)="abc"
^Y(1)="pqr"

Regards
-- Bhaskar
 
 
 

To search mask in the global ?

Post by va » Fri, 08 Jan 2010 00:42:25


I decided the question this way:

Load(Mask,Er)
Set Dev="/usr/temp/zwr/"_$Job_".txt"
Open Dev:(exception="goto Exit")
Use Dev:exception="goto EOF"
ZWR @Mask
EOF
Close Dev
Quit
;
Open(array,cik,Er)
Set Dev="/usr/temp/zwr/"_$Job_".txt"
Open Dev:(readonly:exception="goto OpenError")
Use Dev:exception="goto OpenError"
For cik=1:1 Read x Use $I Set array(cik)=x
Quit
OpenError
Close Dev
Do Delete(Dev)
Quit
;
Delete(Dev)
Open Dev:(readonly:exception="goto Exit")
Close Dev:(DELETE:exception="goto Exit")
Exit
Quit


We have to first write to a file and then delete a failed accumulate a
lot of rubbish except a lot of users...
If it is written in the virtual file or a spool would be even better!
But if you command ZWRITE have a code of M, it would be perfect ZWR
works with all combinations of masks!

Regards