Questions tagged [objectscript]

ObjectScript is a general purpose object-oriented programming language. It is designed to be simple to learn, easy to use, yet still powerful, combining the convenience of an interactive interpreter with many of the features of Java.

ObjectScript is a general purpose object-oriented programming language developed by InterSystems Corporation. It is designed to be simple to learn, easy to use, yet still powerful, combining the convenience of an interactive interpreter with many of the features of Java:

  • a simple java-like syntax
  • class system, with single inheritance and mixins
  • private/protected/public fields and methods
  • exceptions for error handling
  • synchronization and threading
  • compiles to bytecode for higher performance
  • osdoc: a javadoc-like tool to extract API documents
  • from src code, plus API docs accessible reflectively
  • XML-RPC support
  • Windows COM support
  • regular expressions (requires java v1.4 or later)
63 questions
2
votes
2 answers

Intersystems caché - programmatically create new class

Is it possible to write ObjectScript method, which will create new class in namespace and compile it? I mean programmatically create new class and store it. If so, can I edit this class using ObjectScript later(and recompile)? Reason: I have class…
mrfazolka
  • 780
  • 1
  • 7
  • 24
1
vote
1 answer

facing the error “command 'vscode-objectscript.explorer.refresh' not found” in Visual Studio Code (Version 1.49.0) with IRIS 2020.1.0.215.0

I'm facing the error “command 'vscode-objectscript.explorer.refresh' not found” in Visual Studio Code (Version 1.49.0) with IRIS 2020.1.0.215.0. My settings are the following : { "objectscript.conn": { "active": true, "host": "localhost", "port":…
1
vote
0 answers

How can I add two or more file attachments using %Net.MailMessage in intersystems-cache?

I've tried this: s status=msg.AttachFile("F:\MyDir","myFirstFile.pdf",1,.count) s status=msg.AttachFile("F:\MyDir","mySecondFile.pdf",1,.count) I want to add two or more attached files. But it's not working at all... Thank you in advance!
1
vote
1 answer

Cache Variable Scope in Cache Server Page (CSP)

I am trying to store a temporary data in the CSP. I try to avoid ^Global and %session due to concurrency concerns, and avoid Javascript variable due to security concerns. Then I encounter a confusion. Codes below are all in one single CSP:
Darky WC
  • 131
  • 2
  • 12
1
vote
2 answers

Unable to set variable value from Intersystem Cache Server Method

I have came across a question when I am doing Intersystem Cache Server Page with Javascript. Here is my Sample Code: Case 1:
Darky WC
  • 131
  • 2
  • 12
1
vote
3 answers

Access instance variables in Cache Objectscript

I have a routine where I dynamically instantiate persistent objects using reflection. One of the properties of the object, which is also a persistent object, fails when I try to instantiate it using reflection ($Property). It fails because the…
wipallen
  • 144
  • 2
  • 11
1
vote
1 answer

ObjectScript Library.FileBinaryStream convert into a string

How can I create a string a from binary stream? I tried StreamGet and OutputToDevice class methods but that is not returning the string. Is there another class I should use Thanks :)
Jefferson
  • 173
  • 2
  • 12
  • 32
1
vote
1 answer

Does object script supports multiple inheritance?

I am new to cache and found something different from normal oop concept. In object script a base class can be inherited from multiple subclasses(inheritance order can be left/right). If objectscript is oop, I don't know how cache supports…
Vivek Ranjan
  • 1,432
  • 2
  • 15
  • 37
1
vote
2 answers

Build a RESTful POST API in ObjectScript

how to build a RESTful POST API in ObjectScript whereas schema is like this. It should accept myList conforming to the schema. { "$schema": "link", "type": "object", "properties": { "myList": { "type": "array", …
Sally Peter
  • 43
  • 1
  • 5
1
vote
2 answers

MUMPS $Functions in SQL Statements

Can $Functions like $Extract, $P be used in SQL statements? If they can, please provide and example. Ex Select $P(Field1,"*") from MyTable. This returns an error saying "A term expected beginning with either..."
user6284097
  • 157
  • 1
  • 1
  • 9
1
vote
1 answer

Can $bit() create variables here?

Code extracted from this project: Method RefineSearch(pNewCriteria As %String) As %Status [ ZenMethod ] { set tSC = $$$OK try { set ..criteria = ..criteria _$s(..criteria="":"",1:",")_pNewCriteria set tType =…
fge
  • 119,121
  • 33
  • 254
  • 329
1
vote
1 answer

What is a "non multidimensional object property" exactly? (ref: doc of $LISTDATA)

The documentation of $LISTDATA says, with regards to the third argument, that: The var parameter cannot be a non-multidimensional object property. Attempting to write a value to a non-multidimensional object property results in an error. OK, so…
fge
  • 119,121
  • 33
  • 254
  • 329
1
vote
1 answer

What does that line mean in ObjectScript?

This is a line in class MonCache.DB of this project: s fieldsNames = ##class(MonCache.Types.Object) modificationOperator.getNames() It is the first time I see that... Is that a cast, by any chance?
fge
  • 119,121
  • 33
  • 254
  • 329
1
vote
1 answer

Is there a way to programmatically evaluate a macro?

For example, let us take this code: Method m() { $$$someMacro } Or: Method m(foo as whatever) { $$$otherMacro(foo) } Provided that I can extract someMacro and otherMacro from the code samples above, is there a way to programmatically expand…
fge
  • 119,121
  • 33
  • 254
  • 329
1
vote
2 answers

What characters are usable in a variable name in ObjectScript on a "Unicode" installation?

I have a parser (in Java) for ObjectScript which works quite well, except for one thing: I don't parse "Unicode variable names". The problem is that the documentation is not very explanative on this subject; and what is more, it misdefines Unicode…
fge
  • 119,121
  • 33
  • 254
  • 329