Hi,
I create a cache class program. Its compile it. But how to run it?
Please send one sample program with output
An object data model is that data or code is composed of modules that combine data and procedures that work on the data.
Hi,
I create a cache class program. Its compile it. But how to run it?
Please send one sample program with output
I need a generic way to check if all the properties on an object instance are null. Has anyone got some code they could share?
I could of course add a method to each class and pass in all the properties and test them but I'm sure there must be a generic way to do this. A generator method perhaps?
Regards
Mike
Hello,
I've been doing this for years. Well, decades. And, I pride myself in being able to break other people's code.
However, sometimes I don't apply the same dedication to breaking my code. That needs to change. ![]()
So, I'd like to ask people, what are some of the things you like to test for when trying to stress-test your code? I'll start with what I like to try testing to see what crashes, what works unexpectedly, and what I've handled.
I always test the following: 0; 1; -1; some 20-digit number; some 50-character string; 1/0; 2E12; " ", and an undefined variable.
Studio's "Package Information" dialog, accessed from the context menu of a package on the Namespace tab of the Workspace pane, includes a field titled "Routine Prefix"
Help says this is a "String that is used as a prefix for the routines generated from classes in this package".
But if it set a string here, then recompile a class in the package, it doesn't affect the name of the generated routine(s). Nor does it influence the routine names generated when I create new classes in the package and compile them. I have tested on 2016.1.
I want to override the Get and Set methods of a class property. The class maps to a pre-existing global. The property is defined like so:
Property Invalid As %Library.Boolean;
with the property mapping to a node like ^GLOBAL(Code,"INVALID")=1
Code is a property in the same class.
The value can be 0 or 1 or the node might not exist. When it doesn't exist I want the value of the SQL field to come out as 0 (false).
Cache 2015.2
I need to get a sort order stored in my database with mutiple decimal places, but I want the string stored and retrieved EXACTLY as I enter it. so if someone enters 700.3000 I don't want cache to treat it as a decimal and strip the trailing zeros storing it as 700.3
once it comes back, I want the sorting to sort AS STRINGS, again, none of that stripping training/leading zeros.
this ay, I can create local arrays in exactly the order they think? they created them
I realise I can add another decimal point at the end eg 700.3000.
Hello, guys.
I have a set of file names (e.g. file.cls, file2.mac and so on) and I need to check whether these files are mapped in %ALL or current namespace.
I found that if I open Globals in the current namespace I can see mapped packages. And If I open this global I see all files that are to this namespace and %SYS. The problem is these files are enumerated in a json object(apparently)
ex. "{""class"":{""%Activate.Enum"":{},""%Activate.GenericObject"":{""CreateObject"":0,""GetObject"":0},""%Activate.HandleEvents"")
But, is there a way to determine whether this file is mapped using some method?
Let's say that we wish to store the documents sent to us via all of our Customers, and that the documents could be in PDF, spreadsheet, RTF, plain text, Comma-Separated-Values and XML.
It would be hoped that %Stream.Object would be a good choice of property to hold these documents, especially as you would expect %Stream.Object to morph between BINARY (for PDF, spreadsheet, RTF) or CHARACTER (for plain text, CSV, XML) depending on which type of stream was being persisted.
One might expect that .
Hello, guys.
Is there a way to create a dashboard programatically?
I have a source code of a dashboard in udl format and I need to somehow import it in my project.
%Compiler.UDL.TextServices works only with classes and
This article created as side effect of preparations to the longer set of articles about simple, but still handy MapReduce implementation in Caché. I was looking for relatively easy way to pass arguments to (potentially) multiple targets via remote calling facilities. And after several attempts I have realized that we do have very powerful mechanism in the Caché ObjectScript which might be of particular help here – dynamic dispatch for methods and properties.
Since Caché 5.
Hello, guys.
I want to add a class to my project. This class is in UDL format.
I know that there is a method: ##class(%Compiler.UDL.TextServices).SetTextFromStream. The problem is that to use this method I need to know the name of the class (including all packages) in advance. But, a class can have any name(I mean C:/source/AAA/BBB/CCC.cls, but the real name is Sample.Human.cls).
For now I found only one way to get to know the name of a class - just parse the class code and search for a word which is followed by "Class" word. Is there any better way to do that?
P.S.
Hello, guys.
I have an external file that contains data in UDL format(as in Studio, not XML) and I need to somehow overwrite my source file with that file.
I tried to use this snippet for .mac file
w rtn.Code.WriteLine("some text")
It says that status is 1, but I don't see any difference in my source file.
Is there any way to overwrite source files, not only .mac but .cls, .int, .dfi?
I've created a CSP page to take in a base64 value from a <textarea> and decode it. When I run it I get the error . Any ideas?
Error: <ILLEGAL VALUE>zOnPageBODY+28^csp.decode.1
ErrorNo: 5002
Here is my code
<table>
<tr><td><textarea rows="40" cols="200" name="submitstring"></textarea></td></tr>
<tr><td><select name="decodeoption"><option>Decode</option><option>Encode</option></select><input type="submit"/></td></tr>
<tr><td> </td></tr>
<tr><td><h2>Result</h2></td></tr>
<tr><td>
<script language=Cache runat=server>
Set tString = $Get(%request.
Here's a code snippet to calculate the length of a class or a package in lines of code:
ClassMethod ProjectLength(Mask As %String = "%Package%")
{
Set count = 0
Set sql = "SELECT Name "_
"FROM %Dictionary.ClassDefinition "_
"WHERE NOT Name %STARTSWITH '%sqlcq' AND Name LIKE ? AND GeneratedBy IS NULL"
Set rset = ##class(%SQL.Statement).%ExecDirect(, sql, Mask)
While rset.%Next() {
Set class = rset.%Get("Name")
Do ##class(%Compiler.UDL.TextServices).GetTextAsArray(, class, .I am testing application code and want to simulate error conditions.
I am trying to use the following to define a custom error with a class method.
$SYSTEM.Status.Error($$$GeneralError,"Any text here")
My class method code looks like this....
Class compile fails because the $$$GeneralError is unknown.
TEXT: set RunStatus=$System.
Job Description
Caché Objects Web Developer
An excellent opportunity exists for an enthusiastic Caché Objects full stack web developer to join our rapidly growing company based near Old Street.
Our customers use our software to manage events, from small meetings to high-profile conferences and shows. The quality of our software is critical to their success, and critical to our business.
The successful candidate will join our agile software development team and will play a key role in ensuring that we deliver great software to our customers.
Customer is using an ancient MSM based client Workstation for their application and they made a small change to their server code. They introduced property of %Double() and discovered an issue. The MSM workstation is not able to retrieve any property of an object instance that holds value of $double(0). see images illustrating the issue.
I'm posting this to DC intentionally before I eventually send it to WRC so others can comment.
Dan
Image 1 - data

image 2 - UI

Hello,
I am still a beginner with COS and am struggling with these concepts. While digging through the official documentation will eventually tell you everything you need to know, getting started is nevertheless not an easy feat...
Is it possible to create a "lists/array/multidimensional 101" page for beginners?
Problem: Caché instance connects periodically to an Oracle database via jdbc and downloads data. Sometimes data on a remote server would change.
I have a production system that has a large dataset of about 2 million rows. I need to create an index on a property but don't want it available to queries until the index is fully populated. Is there a way I can create the indexed, fire off the build, then "activate" the index so queries can use it.
The problem I face is the minute I create the index queries start returning zero rows because it starts using the index. As I start building it starts returning qualifying rows for those it has indexed but misses those not yet processed.
Hi community!
Does anyone know if it´s possible to override a property name to generate a JSON message based on the instance of object?
Thanks,
José Sampaio
Consider a design where there could be three or four or more servers and there is a need to have these eventually consistent between them all (and not considering database mirroring here).
The current Caché documentation here demonstrates this well using object synchronization between two servers, however it doesn't indicate whether more than two servers can participate to create a "mesh type" deployment. Below is a diagram of what I'm curious to know is possible to implement with Object Synchronization.
Often when debugging COS code you get an error message such as '<UNDEFINED>test^routine *test' so the first thing you want to do is to take a look at this code and see what it is doing. From the command line you can:
ZLOAD routine ZPRINT test
Which means splitting the $zerror information into the routine name and the line and adding the zload/zprint commands. Also you often want to view the lines above the one where the error happened as this gives you some context of how you got to this line, using ZPRINT you could 'ZPRINT +1:test' but that may display hundreds of lines.
Since 2013.

Greetings! This article describes yet another simple way of creating installers for the solutions based on InterSystems Caché. The topic covers applications, which can be installed or completely removed from Caché with one action only. If you are still documenting installation instructions that have more than one step to do to install your application — it’s high time you automated this process.
I was writing a routine that called some class methods and when I typed in ##class( and the package, there was a drop down list of all the classes that match that package but when I selected one of the dropdown entries it added the package name again.
For example if I enter ##class(dim.
I am presented with a list of classes in the dim package but when I selected one of them,(dim.OccupationList), what ended up in the editor was
##class(dim.dim.OccupationList
Hi!
Here is April digest of most interesting and valuable postings on Developer Community in April 2016.
Here we go!
News and Events
InterSystems Global Summit 2016 - Session Content
Sources for InterSystems Global Summit 2016 Sessions and Expereiences
On the class reference %Library.GlobalCharacterStream is marked as deprecated in favor of %Stream.GlobalCharacter.
How I can migrate the data from class properties defined as %Library.GlobalCharacterStream to the new one %Stream.GlobalCharacter?
Does the %Stream.GlobalCharacter have the same SQL support from %Library.GlobalCharacterStream?
Thanks.
Hi this is my first post, so a little about my background. I've been programming in PHP/JavaScript for about 10 years.
I've got quite a bit of knowledge surrounding object orientated programming and know the basics.
Last year I looked into the Mirth integration engine and did some work around that.
I've now moved jobs and I'm doing some work (surprise, surprise) with Ensemble.
I've done the tutorial and understand the basics of the web 'frontend' and what an integration engine can do.
I have a Cache classes with %TimeStamp (e.g. 2016-04-18 12:29:11) and %Date (eg. 64027) properties. And I have a javascript client app, which needs full CRUD over this properties.
But in javascript date/time are defined by ISO8601 (e.g. timestamp 2016-04-18T12:29:11Z, date 2016-04-18).
Here's my code (download):
Class Utils.Generators [ Abstract ]
{
ClassMethod B()
{
s ^a = 1
}
ClassMethod A() [ CodeMode = objectgenerator, GenerateAfter = B, PlaceAfter = B ]
{
k ^a
do ..B()
}Now, obviously for it to work I need method B compiled and ready to use before compiling method A().
I test it with the following code:
do $system.OBJ.UnCompile("Utils.Generator")
do $system.OBJ.Compile("Utils.Generator")Yet, I receive the following compilation error:
Compilation started on 04/10/2016 18:39:04 with qualifiers '' Compiling class