Top Stories

There are many ways to generate excel files using Intersystems, some of them are ZEN reports, IRIS reports ( Logi reports or formally known as JReports), or we can use third party Java libraries, the possibilities are almost endless.

But, what if you want to create a simple spreadsheet with only Caché ObjectScript? (no third party applications)

15 15
10 2.2K

A quine is a computer program which takes no input and produces a copy of its own source code as its only output.

Wikipedia.

How about a fun challenge?

The task is to write a quine in InterSystems ObjectScript. It can be a class, or a method, or a routine, or just a line to be executed in a terminal. You decide!

Here's some resources you might consider useful:

Hard mode: do not use source code access functions.

Here's my (extremely uninspired, I know) attempt:

Class User.Quine
{

/// do ##class(User.Quine).Test()
ClassMethod Test()
{
    set sc = ##class(%Compiler.UDL.TextServices).GetTextAsString($namespace, $classname(), .str)
    write str
}

}

It produces this output:

How many different ways of producing a quine are there in ObjectScript?

9 15
0 625

Hey Community,

Please join the next InterSystems online programming competition:

🏆 InterSystems FHIR Accelerator Programming Contest 🏆

Submit an application that uses InterSystems FHIR-as-a-service on AWS or helps to develop solutions using InterSystems IRIS FHIR Accelerator.

    Duration: May 10 - June 06, 2021

    Total prize: $8,750

    👉 Landing page 👈

    6 15
    1 2.9K
    Question
    · Mar 31, 2021
    End Session programmatically

    We have a background job that keeps an eye on our ongoing CSP sessions, counts licenses used and some other tasks. Question: If I know the session ID (something like "wuuZ2Gwgxw"), how do I (find and) end that particular session programmatically in ObjectScript - i.e., the equivalent of %session.EndSession=1 in the csp page code?

    Thanks!

    Michael Reach

    1 15
    2 1K