6.0 C/S read from file

Posted April 23rd, 2012

; routine to copy data from a memory buffer into a RAF
; the entire memory buffer is copied (eg. we first do @Memory.beginning(A))
;
; A is the memory buffer
; B is ^RAF    assumes [A,q]=data
; C tells us how to read data from the memory buffer
;    C|0 = “R”  to do @Memory.read.chars(A,C|1) (#mR)
;    C|0 = “L”  to do @Memory.read.line(A,C|1) (#mL)  (if C|2, do @Text.out of data)
;    C|0 = “Q”  to do @Memory.read.text(A) (#mQ)
;    if no C, do #mQ
; D tells us where to start writing data into the RAF (q number)
;    if D=0, we kill the RAF first and start writing at q=1
;    if ‘D, start writing at q=1 but don’t kill first (likely a new RAF)
;    if D>0, start writing at D+1
;
@Memory.allocate(1)^MEM,
@Memory.clear(MEM),
@Memory.beginning(MEM),
@Memory.load.file(MEM,”V:\TEMP\users.txt”),
%Z.copy.mem.to.raf(MEM,^/FILE),
@Memory.clear(MEM),
@Memory.free(MEM),
“”^XX,DO{+/FILE[XX]^XX 1^/USERS[/FILE[XX]$10:0S]}


6.0 C/S write to file

Posted April 23rd, 2012

; routine to copy data from a RAF into a memory buffer
; the contents of the RAF will be inserted at the current cursor position
;
; A is ^RAF assumes [A,q]=data
; B is the memory buffer
; C TRUE if should append crlf to each line of data read from the RAF
;
@Memory.allocate(1)^MEM,
@Memory.clear(MEM),
@Memory.beginning(MEM),
%Z.copy.raf.to.mem(^/TABLE,MEM,1),
@Memory.store.file(MEM,”V:\TEMP\users2.txt”),
@Memory.clear(MEM),
@Memory.free(MEM)


6.0 prefixes C/S

Posted April 13th, 2012

No limit on open prefixes in C/S. Rah!

Two ways to open prefixes in 6.0 C/S —

1 – %Z.rw.fragment(“”,”ABS.”_(@.db#”1.”))

2 – probably the preferred method
to open – %Z.link.db({“ABS._”@.db#”1.”},{“O”})
to close – %Z.link.db({“ABS._”@.db#”1.”},{“C”})

; —– notes from program —–
; Provides an almost full link/unlink to a database.
; A|0 – db
; B|0 – nil or “O” – open prefixes
; – link to all appl-specific prefixes
; – store db in as current db for that appl.
; – “C” – close prefixes.
; B|1 – “” – do database checks
; “B” – bypass database checks.
; “W” – do database checks, warn if problem, but don’t set error code.
; B|2 – “” – display msgs.
; 1 – suppress msgs. (except for the Database Warning checks)
; B|3 – 1 – set the use.for.switch flag (if doing an open)
; B|4 – 1 – do not open any prefixes. (Used to just do checks.)
; B|5 – 1 – check if server alive before opening prefixes
; Returns:
; If error, error.msg is returned & current db is not set. Some pfxs may be open.
; if no error, return nil.
; Closes will never produce an error msg.


That Spells DNA

Posted January 13th, 2012
Comments Off on That Spells DNA

That Spells DNA


REQ only when Filing

Posted June 2nd, 2010

To invoke a REQ attribute only at the time of filing and not during CDS editing…

This only works on a CDS where the user gets an option to file the CDS by entering F. Normally this applies to a CDS attached to a dictionary (or the Admin Data screen in 3.x but not 4.x) where you get an option to select a page, exit, or file.

X stores the 1, 2 E(xit) F(ile), etc.

REQ=IF{“F”=X …..}


Loops and Subscripts

Posted April 8th, 2009

“”^SUBS,
DO{>(ADM.PAT.events[urn,SUBS],DATA)^SUBS 1,
; — event date
SUBS#0S,
; — event.seq.no
SUBS#1S,
; — etc for child dpms
SUBS#2S
; — event.code OR event.time if in child dpm
DATA|0,
; — event.eff.date OR event.user if in child dpm
DATA|1}


GUI Not Required

Posted January 7th, 2009

Keep fragments to GUI only apps such as EDM and RXM from failing when run from non-GUI workstations. Set the appropriate variable to 1 before executing the fragment call.
EDM – /.HE.NO.GUI
RXM – /.HX.NO.GUI


MSEL

Posted September 23rd, 2008

Used as a footnote to allow selection on a child segment.

The following could be used in combination with selection initials EQ … to find all spool groups that did not include the user. (Report written in mis.spool.group.main)
MSEL @initials NONE

Or with this footnote print all the users (as a multiple) for a group as long as one of them was the selected user
MSEL @initials ANY


Heath’s Post on Fonts

Posted November 15th, 2007

The easiest way to increase or decrease font size in IE6, IE7, or Firefox is to use Crtl+ or Ctrl-. You can also select the Text Size option from the menu.
Firefox – click on View ^ Text Size ^ Increase or Decrease
IE7 – click on Page ^ Text Size ^ pick a size

IE6 – click on View ^ Text Size ^ pick a size


PCI Menu Lookup in NPR Report

Posted November 9th, 2007

Step 1. Set up a macro in the report with this code. You will need to change the references to PCI.MEM to match you PCI database. Make sure it ends with a ; so it can be called as a program.

IF{+/MENUS[“”]_0’=0;
$MAC^SEG,
$[“DIR.NAME”](%)#0P^DIR,
@MIS.APPL.database.segment[“PCI.MEM”]^NEWSEG,
@MIS.APPL.database.directory[“PCI.MEM”]^NEWDIR,
$[“SEGS”](NEWSEG,NEWDIR),
CL(&S),
ZZZ%OP(&,%[“pci.data”]),
“”^MENU,
DO{+&.MNU[MENU]^MENU Q(“Y”,&.MNU[MENU]ID%1)^/MENUS[MENU]},
CL(&U),
CL(%U,$U),
$[“SEGS”](SEG),
$[“DIR”](DIR)},
1;

Step 2. Add this ID attribute and change the IFE attribute for your pci menu field using option 8 on the report process routine. The macro name in the IFE attribute must match the macro name that you created in step 1.

ID=%Z.id.dict.color(^/MENUS,A,”Mnemonic”:12L_(“Name”:50L),”CD:12L_[A,CD]|1″)X
IFE=%MIS.USER.zcus.tjt.pci.menu.lookup.M.pci.menus(0),1


Next Page »