You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
; Important: You musn't check variables in your own job, it will result in a <PARAMETER>-Error!
Set checkjob=1234
Set checkvar="foo"
; Check if job is not my own
Quit:checkjob=$Job
; Check if Job exists und prompt the content of the varible foo
If $Data(^$Job(checkjob)) W !,$ZUtil(88,2,checkjob,checkvar)
; Prompts the content of the variable foo, maybe it is 'bar' ;-)
82
Caché
Textdateien
Textdatei schreiben
Set file=##class(%File).%New("file.txt")
Write file.Size
Do file.Open("WSN")
Do file.WriteLine("This is a line of text")
7
Mumps
Datum, Zeit
Aktuelles Datum/Uhrzeit
; The first integer is the number of days since December 31, 1840, where day 1 is January 1, 1841. The second integer is the number of seconds since midnight of the current day
Set h=$horolog
S h=$H
W !,h ; gibt aus 61793,34937 was dem Datum 2010-03-08 und der Uhrzeit 09:42:17 entspricht
11
Mumps
Datenbank
Lesen Datensatzes
; In M werden Tabellen Globals genannt
S id=1
W !,^TABLE(id)
S street="Hollywood Drive"
S city="Los Angeles"
W !,^PERSONS(street,city)
S temp=^GLOBAL(0,"test","temp1")
14
Mumps
Array
Array definieren
S arr("dim1","dim2")="value"
Set arr("dim1",99)=187
; Persistent, will be saved with prefix ^:
S ^save("dim1","dim2")="saved value"
16
Mumps
Variablen
Existenz der Varible abfragen
Set status=$Data(test)
If status Write !,"Variable existiert: "_test
I '$D(test2) W !,"Variable existiert nicht!"
21
Mumps
Variablen
Var-Dump einer Variable
ZW test
S A(1,2)="Inhalt"
ZWrite A
Set ^GLOBAL1("sub1","sub2")="content"
ZW ^GLOBAL1
33
Mumps
Strings
String nach Delimenter zerlegen
myString="A;B;C;D;E"
Write !,$Piece(myString,";",3) // gibt C aus
40
Mumps
Strings
String nach einem Teilstring durchsuchen
Set fullstring="This is my string"
Set searchfor="my"
If $Find(fullstring, searchfor) Do
. Write !,"I found it!!"
. Quit