The following code snippet is a REGEX that validates characters that are not in English, as well as English characters. The class method "test" takes an email address and validates it based on this additional criteria:
(Originally posted by @Eduard Lebedyuk on Intersystems CODE, 6/26/14) This code snippet determines the difference between two ObjectScript lists. The class method "test" runs the code, and its parameters are detailed in the comments:
The following code allows a user to view the audit settings of their instance. Run the code by running the class method "test":
class objectscript.checkAudit Extends %RegisteredObject
{
classmethod test() {
w "Checking for Auditing.",!
Set SYSOBJ = ##class(Security.System).%OpenId("SYSTEM")
If +SYSOBJ = 0 Set SYSOBJ = ##class(Security.System).%New()
i SYSOBJ.AuditEnabled {
w "Security Auditing is enabled for the following services",!
s rs=##class(%ResultSet).%New("Security.The following code snippet uses GZIP to compress/decompress a file. Choose a file by specifying a file path in the "filename" variable.
Class objectscript.GZIP Extends %RegisteredObject
{
classmethod test() {
//Export Global(s) uncompressed
set filename="C:\Temp\myglobal.xml"
do $System.OBJ.Export("^oddEXTR.gbl",filename)
//Open exported Globals
set uncompressed = ##class(%FileBinaryStream).%New()
set uncompressed.Filename=filename
Set compressed = "C:\temp\mycomglobal.