Jump to content
Wikipedia The Free Encyclopedia

Caché ObjectScript

From Wikipedia, the free encyclopedia
Programming language
This article has multiple issues. Please help improve it or discuss these issues on the talk page . (Learn how and when to remove these messages)
This article may contain excessive or inappropriate references to self-published sources . Please help improve it by removing references to unreliable sources where they are used inappropriately. (October 2011) (Learn how and when to remove this message)
This article possibly contains original research . Please improve it by verifying the claims made and adding inline citations. Statements consisting only of original research should be removed. (October 2011) (Learn how and when to remove this message)
The topic of this article may not meet Wikipedia's general notability guideline . Please help to demonstrate the notability of the topic by citing reliable secondary sources that are independent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to be merged, redirected, or deleted.
Find sources: "Caché ObjectScript" – news · newspapers · books · scholar · JSTOR
(October 2011) (Learn how and when to remove this message)
This article relies largely or entirely on a single source . Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.
Find sources: "Caché ObjectScript" – news · newspapers · books · scholar · JSTOR
(April 2024)
(Learn how and when to remove this message)
Caché ObjectScript
First appeared1997
OS Cross-platform
Influenced by
MUMPS

Caché ObjectScript is a part of the Caché database system sold by InterSystems. The language is a functional superset of the ANSI-standard MUMPS programming language. Since Caché is at its core a MUMPS implementation, it can run ANSI MUMPS routines with no change. To appeal as a commercial product, Caché implements support for object-oriented programming, a macro preprocessing language, embedded SQL for ANSI-standard SQL access to M's built-in database, procedure and control blocks using C-like brace syntax, procedure-scoped variables, and relaxed whitespace syntax limitations.

The language has private and public variables and globals. Global has a different meaning in this language than in most; such variables are global across routines, processes, and sessions. Thus, editing a global variable is making permanent and immediate changes to a system-universal database (which survives reboots, etc.). The scope of a private variable is the local function, the scope of a public variable is the entire process. Variables, private and public, may be single elements or complete multi-dimensional arrays.

The great majority of Caché's feature-set is inherited from the ANSI MUMPS standard. See that article for details on how data is represented and the different ways a programmer can think about the data during development.

Caché programming examples

[edit ]

Hello world program as a routine

[edit ]
hello // hello world routine
 write "hello world"
end quit // end

Then in Caché Terminal (assuming you wrote the hello routine to the SAMPLE namespace):

SAMPLE> DO ^hello

[1]

Hello world program as a ClassMethod

[edit ]
Class User.Helloworld
{
 ClassMethod HelloWorld()
 {
 // Write to console
 Write "Hello World"
 Quit
 }
}

Then in Caché Terminal (assuming you wrote the User.Helloworld Class to the SAMPLE namespace):

SAMPLE> DO ##class(User.Helloworld).HelloWorld()

See also

[edit ]

References

[edit ]
[edit ]


Stub icon

This programming-language-related article is a stub. You can help Wikipedia by expanding it.

AltStyle によって変換されたページ (->オリジナル) /