Robert Cemper · Mar 26, 2019 go to post

can't import %routines which I need. 

Without any special mapping, %routines are stored in SYSLIB. (except %z*,%Z*)

Mount SYSLIB (default: read-only) as Read/Write and you can load your %routines. 

Needless to mention that you better not overwrite already existing %routines.
The effects could be unpredictable.

Robert Cemper · Mar 26, 2019 go to post

As you describe it I'd create a nice BAT file that you execute.
It coud be static or created ad hoc just by writing it from Caché

And then execute it using $ZF(-1...) ,$zf(-2....) or CPIPE 

Though Caché has powerful utilities around %File class you will be faster that way

[based on ~40 yrs of M]

Robert Cemper · Mar 21, 2019 go to post

to create your own Login Page you best start with Class  %CSP.Login and adapt it to your specific needs.

defaulting to

and then you add the new Login Page to Security-> WebApplications

Robert Cemper · Mar 16, 2019 go to post

Size of WIJ is in Relation to Global   Buffers. With equal size of G.Buf. you should get similar size  of WIJ

Robert Cemper · Mar 11, 2019 go to post

that's wrong !  "will execute nothing, "   

if condition

Sets the system variable $TEST.   
And this was and still is a widely used way of signaling between routines and functions.
And millions lines of existing code rely on its proper use.

I come back to an earlier comment: Really learning the language is definitely an advantage.

Robert Cemper · Mar 11, 2019 go to post

returning to dotted subroutines would be really bad. Though they are still around in %SYS.  laugh

on the other hand, the flexibility of the language allows a broad range of personal styles.
knowing them enabled me in the past (amongst my customers ) to identify the author of a routine
just by his style with a hit rate of >75%.  devil

Robert Cemper · Mar 11, 2019 go to post

OK Vitaly !

It happens under cover  (from: ^%SYS.SECURITY1.int

Set $zt="SSLConfigError"
'($e($roles,1,$l("%All"))="%All") $ET,$roles $ET="",$roles=$roles_","_"%All"}
  $namespace
Do $zu(5,"%SYS")

 
Robert Cemper · Mar 11, 2019 go to post

Alexej,

if you don't care about maintenance effort the most exact pointer is preferable.

As you may see from Ensemble the number of entries in the mapping table is of no importance.
With modern hardware, saving memory is of no importance anymore.

Robert Cemper · Mar 10, 2019 go to post

I remember times when new programmers learned from their masters to use no matter what
programming language in her full beauty and elegance with all its features.
no matter if this was Assembler/360 or Macro32 or C, C++, C# or Bliss or PL/1 or Fortran, Algol, .... [list almost unlimitted]

All of them had their tricks and open and hidden features that inspired the creativity of developers
and allowed them to create artwork instead of stereotypic formulated phrases. By this approach,
developers get degraded from architects to monotone brick assemblers.

"users unfamiliar with the language" 
I'd recommend they should learn it to understand it before touching it.
If I want to read the Правда  I have to learn Cyrillic characters and the Russian language to understand it.
Nobody would accept any request for Latin letters.

Robert Cemper · Mar 10, 2019 go to post

Hmmm,
it seems to prefer "waste screen space" style 
over "have all on 1 screen with no scrolling"   [my favorite ]

Robert Cemper · Mar 8, 2019 go to post

Hi Tim

write $d(^|"%SYS"|SYS("Security","SSLConfigsD",<my config> ),settings)

provided you have access rights

Cheers, Robert

Robert Cemper · Mar 4, 2019 go to post

You have to set your DB to be in Primary MIRROR before the copy.
Otherwise, you may miss some kind of "Mirror-Marker" / Timestamp. 

I hit this trap also on my first trials.

Robert Cemper · Mar 2, 2019 go to post

I just realized that this method doesn't check the existence of the ID.

therefore:

write:##class(Abstract.Class).%ExistsId(id) $li(##class(Abstract.Class).%ComposeOid(id),2)

or any equivalent construct.

Robert Cemper · Mar 2, 2019 go to post

OID contains the class name. So this should do it.

write $li(##class(Abstract.Class).%ComposeOid(id),2)

Robert Cemper · Mar 2, 2019 go to post

You are totally right.

With Parent-Child your data are not only logical but also physically tied to each other.

One-to-many allows you more flexible handling of Relations.

Just one out of many examples   M:N Relationship

Robert Cemper · Mar 1, 2019 go to post

Exactly 4 weeks before UK is leaving the European Union on Friday, March 29th this sounds like kind of British humor to me.

Robert Cemper · Feb 25, 2019 go to post

Thanks @Jeffrey Drumm  !

I always distrusted HL7 separators and ESC chars. when I first met them ages back as they carry the same limit as $PIECE() with them:
"There is always somewhere some odd case where your separator turns up as content. "  
Praise $LB()  wink !  
 

Robert Cemper · Feb 25, 2019 go to post
set remove="\E"
set hl7="OBX|1|RP|ECG||CARDIO ECG^APPLICATION^PDF^^\E\\E\sitehopital.org\E\files\E\cardio\E\022018\E\GE274583.PDF|"
set clean=$replace(hl7,remove,"")
 write clean
OBX|1|RP|ECG||CARDIO ECG^APPLICATION^PDF^^\\sitehopital.org\files\cardio\022018\GE274583.PDF|
Robert Cemper · Feb 21, 2019 go to post

for that case passing the variables by reference should be sufficient. 

ClassMethod Main() 
{
    Do ..InvokedMethod(,var1,.var2)
    W !,var1
}
ClassMethod InvokedMethod(byRef var1, byRef var2) 
{
    Set var1 = "ChangedInInvoked"
}
Robert Cemper · Feb 21, 2019 go to post

I see 5 options :

  • any classmethod can be projected as SQL Procedure. So using your ODBC adapter you may communicate that way with Caché
    based on rather poor personal experience of PHP & ODBC it is definitely not my favorite.
  • With Angular & PHP you are in the Web environment. So SOAP Webservices may be useful.
    I had a very positive experience with that approach. see it here  Feeling the power of Caché
  • Actually I would rather use REST in combination with JSON
  • If rather synchronous interaction between both sides is required AJAX (+JSON) could be a way 
  • Or for longer lasting asynchronous communication WebSockets might be appropriate.

So you have a choice what fits best to your needs.

Robert Cemper · Feb 19, 2019 go to post

interesting observation  with CHPC 65001:

a loop USER>for i=1:1:255 write i," ",$c(i),!   stops the session with any character > $c(127).

I'd suggest forget that M$ crap.
Use Putty or any thing else.

Cache for Windows (x86-64) 2018.1.1 (Build 312U) Thu Jan 3 2019 14:34:00 EST