Download presentation
Presentation is loading. Please wait.
Published byRuth Burke Modified over 8 years ago
1
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security Service
2
6/15/200715th VistA Community Meeting2 Objectives What is Eclipse? Do I need to know any Java? (NO!) A functional MUMPS (or M) editor with syntax coloring. Setting it up Options & Features Examples of its use
3
6/15/200715th VistA Community Meeting3 What Is Eclipse? Eclipse is an Integrated Development Environment (IDE). It is written in Java, and was originally a Java development environment. It uses a plug-in architecture to provide for extension of the capabilities. It is now used as an editor and development environment for many languages.
4
6/15/200715th VistA Community Meeting4 Do I have to know any Java? NO!!
5
6/15/200715th VistA Community Meeting5 How do I get and Install Eclipse? Eclipse was originally developed by IBM, but was converted to an open source project. The most recent version can be downloaded as a zip file from http://www.eclipse.org.http://www.eclipse.org Simply unziping the file (with ‘use folder names’ checked) into a desired directory such as C:\ or C:\Prog results in Eclipse being put into C:\Eclipse or C:\Prog\Eclipse. Start Eclipse by double clicking on the Eclipse.exe program in the Eclipse directory.
6
6/15/200715th VistA Community Meeting6 The Eclipse Editor on first use
7
6/15/200715th VistA Community Meeting7 The Basic Eclipse Editor (after clicking on the ‘Go To Workbench’ arrow)
8
6/15/200715th VistA Community Meeting8 Unzipping the VistALink Plug-in
9
6/15/200715th VistA Community Meeting9 The M icon and VistA menu added by the M-Editor Plug-in
10
6/15/200715th VistA Community Meeting10 The VistA menu Items
11
6/15/200715th VistA Community Meeting11 Setting VistA Preferences -1
12
6/15/200715th VistA Community Meeting12 Setting Preferences for the VistALink Connection
13
6/15/200715th VistA Community Meeting13 Setting Preferences for the M-Editor functionality
14
6/15/200715th VistA Community Meeting14 After Clicking OK for the Preferences and then Clicking on the Green ‘M’ icon
15
6/15/200715th VistA Community Meeting15 After Selecting the Routine, You have to sign on to the server
16
6/15/200715th VistA Community Meeting16 And the routine is loaded
17
6/15/200715th VistA Community Meeting17 The center section is the editing area, and multiple routines may be open at one time (tabs)
18
6/15/200715th VistA Community Meeting18 The Left Panel contains projects – only files which are in a project may be edited – the default is mcode. An ‘m’ extension is used for the files.
19
6/15/200715th VistA Community Meeting19 The right panel contains an outline of routine tags. Selecting one of these will jump to that location in the routine.
20
6/15/200715th VistA Community Meeting20 Adding a new section of code. The error is intentional.
21
6/15/200715th VistA Community Meeting21 The left gutter is marked where lines have been added or changed. The tab is also marked to indicate a modified routine.
22
6/15/200715th VistA Community Meeting22 The outline also shows the added tag.
23
6/15/200715th VistA Community Meeting23 On saving the routine (cntrl-S or the icon), it indicates an error encountered.
24
6/15/200715th VistA Community Meeting24 The problems are identified in the M-Editor Console at the bottom. It points out the error, and several variables which are at risk (neither arguments or newed).
25
6/15/200715th VistA Community Meeting25 On saving a routine The routine is written to the project (mcode by default). The server is checked to insure that the routine on the server hasn’t changed since it was loaded into Eclipse. If the server version hasn’t changed (or you approve the write over), the routine is saved on the server. The part of XINDEX checking for errors is run with the routine. Any warnings or errors cause a dialog box to pop-up to insure that the user is aware of the problems.
26
6/15/200715th VistA Community Meeting26 On Saving A Routine - 2 The routine is checked for variables which are not arguments and which have not been newed. In most cases, you probably want to protect them. Variables which are expected to be visible outside the routine can be identified with a special comment e.g. ; ZEXCEPT: IO,DUZ KERNEL VARIABLES If an M-Unit test has been identified for the routine, the unit test is run and the roll & scroll results are shown (periods for passed tests, Texts for failures or errors).
27
6/15/200715th VistA Community Meeting27 On Saving A Routine - 3 The default action on saving is to enter or update the routine in the ROUTINE file, and to update the date and time for the routine on the first line.
28
6/15/200715th VistA Community Meeting28 So, I fixed the error and NEWed the variables.
29
6/15/200715th VistA Community Meeting29 On Saving again A dialog box appeared indicating no problems identified.
30
6/15/200715th VistA Community Meeting30 Some Benefits of the Project Entries The mcode project in the left panel now contains the most recent version of the routine that was edited. Right Click on the routine, and a number of options are available. –Properties – An M-Editor section allows an M-Unit routine to be specified. –Compare With local history allows the current routine to be compared with prior versions (the length of time the routines are saved is determined by a preference (General – Workspace – Local History)) –Replace With allows the current routine to be replaced with an earlier version.
31
6/15/200715th VistA Community Meeting31 M-EditorProperties for XTMDUTIL
32
6/15/200715th VistA Community Meeting32 Compare with Local History lets you walk through the changes. You can then use the Replace With to restore a prior version.
33
6/15/200715th VistA Community Meeting33 If a routine is specified for loading that doesn’t exist on the server, it provides a place to generate the comments for the first two lines (and specify an M-Unit routine for the new routine)
34
6/15/200715th VistA Community Meeting34 And then opens the new routine in the editor for further editing
35
6/15/200715th VistA Community Meeting35 There are other functions on the VistA menu available as well A listing of routines with names beginning with specified characters A listing of globals with names beginning with specified characters A listing of global values (both a simple listing and a listing which can be copied and pasted into another account). These are all non-editable, but can be copied for editing elsewhere.
36
6/15/200715th VistA Community Meeting36 A request for a Routine Directory listing
37
6/15/200715th VistA Community Meeting37 Generates the listing below
38
6/15/200715th VistA Community Meeting38 A request for a global directory listing
39
6/15/200715th VistA Community Meeting39 And a list of global names beginning with X
40
6/15/200715th VistA Community Meeting40 A request for a global listing – note the “Setup for copying” check box
41
6/15/200715th VistA Community Meeting41 A normal global listing
42
6/15/200715th VistA Community Meeting42 And a global listing setup for copying
43
6/15/200715th VistA Community Meeting43 Work in progress – In addition to the Red M on Green, there is a bug on an M
44
6/15/200715th VistA Community Meeting44 Selecting the Option or the M-bug icon displays a dialog box for the code to be processed
45
6/15/200715th VistA Community Meeting45 An OK on the dialog box causes the Eclipse to change to a debugging perspective for M
46
6/15/200715th VistA Community Meeting46 The upper left section displays the stack, the current line of code, the last command executed and the next to be executed, it also contains the icons for controlling progress.
47
6/15/200715th VistA Community Meeting47 The upper right area has panels for breakpoints in the code, variable values, setting watch variables, and their display, and initialization values
48
6/15/200715th VistA Community Meeting48 The middle and bottom portions contain the code being processed and the console for text display and input
49
6/15/200715th VistA Community Meeting49 Debugging Initially, the debugger displays only the line to be processed. The debugger can be set to step over commands or to run (in the latter case, stops will be made when watch variables change or when a line of code specified as a breakpoint is reached).
50
6/15/200715th VistA Community Meeting50 The code that will be processed
51
6/15/200715th VistA Community Meeting51 Setting two breakpoints
52
6/15/200715th VistA Community Meeting52 Setting two watch variables (Y and VAL1)
53
6/15/200715th VistA Community Meeting53 After a couple of steps
54
6/15/200715th VistA Community Meeting54 The mass of variables can be selected with filters (at the bottom)
55
6/15/200715th VistA Community Meeting55 After running, it stopped because of the watch variable Y, the current line of code is the third from the top of the code shown. Also, text was written to the console.
56
6/15/200715th VistA Community Meeting56 This stopped due to one of the breakpoints
57
6/15/200715th VistA Community Meeting57 This stopped due to the watch value VAL1 going from undefined to 3
58
6/15/200715th VistA Community Meeting58 The watch value VAL1 bounces between undefined and defined, note the level of the stack as it calculates a factorial
59
6/15/200715th VistA Community Meeting59 Stopped due to the other breakpoint just before it leaves with the factorial value
60
6/15/200715th VistA Community Meeting60 And processing was finished
61
6/15/200715th VistA Community Meeting61 Summary The Eclipse IDE can be used to edit (and shortly) debug MUMPS code. And you don’t have to know any Java to do it.
62
6/15/200715th VistA Community Meeting62 Questions? And maybe some answers
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.