NEMUG NewsletterJuly 2005 ArticlesDownload the full newsletter in PDF format
Board MeetingsNEMUG Executive Board Meetings are open to anyone to attend. Your presence and views are welcome at any time. The meetings are held on the second Monday of even-numbered months, at the office of Henry Elliott in Wellesley. We try to get started at 6:00 pm. The next meeting is on:
If you are planning to attend, please let a board member know in advance, as we provide food and eat as we work, and need to be sure we have enough for everyone. The complete address for the meetings is: Henry Elliott and Company Inc.
Life is good. All of us on the board won our elections. We have our new board including some new members and some continuing. Congratulations
and Thanks Thanks also to the continuing help from Joe Crisafulli and Bob Macauley who have worked on the newsletter for years. Thanks to Marilyn Paterno, immediate past chair who worked particularly effectively on the NEMUG reunion April 9th. Thanks to Ben Bishop who was not on the NEMUG M Celebration committee but who helped in many ways, especially as ex officio treasurer. The NEMUG web site has moved. Anthony Pilozzi has taken on the transferal of the NEMUG web site to the Intersystems web server. Please take a moment to view the photo gallery and blog. Send us your comments.
Tips and Tricks with Caché
Lori Fassman, May 10, 2005 Create a PDF file from Caché with Caché Activate You can use Caché Activate (a/k/a the ActiveX Gateway) to add functionality to your own application without having to become an expert in that "other thing", e.g., add a spell checker or create PDF files. Demo was done using PDF Lib (see pdflib.com), but this can be done with any third-party PDF generator. Program was written using Caché Basic but would easily have been written in Caché ObjectScript. (I have sample code written both ways.) This technology works just fine against regular globals and routines you don't have to be building your applications with objects and sql to take advantage of this feature. How to use CSP with globals (no objects or SQL) First I created a ^test global: Then built a CSP page which created an HTML table pulling data directly out of the global. Note the <script language="cache"> box below: <table border="1"> <script language="cache"
runat="server"> </table> Escape sequences in CSP/HTML This is more an HTML tip than anything specific to CSP, but it becomes important in CSP sometimes. The question is, how do you get some characters to show up on a web page when Caché and the browser think those characters have a special meaning, like angle brackets (which usually mean the beginning and end of an HTML tag)? You use HTML escape sequences. A quick web search will turn up many tables of all the ASCII characters and their equivalent escape sequences. My demo looked like this: I would like to include a GreaterThan sign and a LessThan sign in my text.
Here goes. Put only
essential data in %session <script language="cache" runat="server"> set pat=##class(NEMUG.Patient).%OpenId(1) do %session.Set("patID",pat.%Id()) </script> How to use $zobjproperty/method/etc. This is similar to indirection, but can be used to find a generic way to get properties from a Caché object, or run methods. Here are three functions, one accessing properties, one accessing "instance" methods (meaning you have to have an object in memory for this to run) and one accessing "class methods", which do not need anything in memory for them to work: testProp(pat,prop) testMethod(pat,method) testClassmethod(method) Now, to call these functions: set pat=##class(NEMUG.Patient).%OpenId(1) Search for $zobjxxx in docs to find documentation on this. Aviel pointed out that Execute works with objects too: Set string="write ##class(NEMUG.Patient)."_method How to Optimize SQL Queries - Always use TuneTable and ShowPlan to optimize SQL queries in Caché. These tools can be found in the Caché SQL Manager. - populate Patient with 100 records (no index, no TuneTable) |
For more information about NEMUG, contact: Gardner Trask at gtrasknemug@gt3.com or call him at (978) 774–1338.
Last Updated: 12-July-05