#Terminal

0 Followers · 217 Posts

Posts that relate to discussions on utilizing the Terminal tool.

Question Jean Millette · Oct 15

Can someone help me understand what type of user error (?) is going on here please?

One one system, I write out a group of $c() values and get the expected results:

USER>for i=250:1:260 { write i," ", $c(i),! }
250 ú
251 û
252 ü
253 ý
254 þ
255 ÿ
256 Ā
257 ā
258 Ă
259 ă
260 Ą

USER>w $zv
IRIS for Windows (x86-64) 2023.1.4 (Build 580U) Fri Apr 19 2024 11:16:07 EDT
USER>

On another system, I get some unexpected results:

0
0 0
Question Yone Moreno Jiménez · Aug 5

Hello, how are you?

First of all thanks for your time reading this question.

We are investigating how to validate the indexes of a global. We have read:

https://docs.intersystems.com/irisforhealth20251/csp/docbook/DocBook.UI…

And:

https://docs.intersystems.com/irisforhealth20251/csp/documatic/%25CSP.D…

We want to validate the inxedes of the global titled "Ens.Util.LogD". We have executed on the ObjectScript terminal, on the desired namespace:

0
0 0
Article Guillaume Rongier · Jul 31 4m read

This article will introduce you to the concept of virtual environments in Python, which are essential for managing dependencies and isolating project from the OS.

What is a Virtual Environment?

A virtual environment is a folder that contains :

  • A specific version of Python
  • At start an empty site-packages directory

Virtual environments will help you to isolate your project from the OS Python installation and from other projects.

How to use it?

To use virtual environments, you can follow these steps:

0
0 0
Article Vachan C Rannore · Jul 24 1m read

Are you curious about how to run Python scripts directly in your InterSystems IRIS or Caché terminal? 🤔 Good news it's easy! 😆 IRIS supports Embedded Python, allowing you to use Python interactively within its terminal environment. 

How to access the Python Shell?

To launch the Python shell from the IRIS terminal, simply run the following command:

do##class(%SYS.Python).Shell()

This opens an interactive Python shell inside the IRIS terminal. From here, you can write and run Python code just as you would in a normal Python environment.

Exiting the Shell:

>>> quit()

0
0 0
Question Fabio Care · Feb 7

Windows 10/Windows Server 2016:

I am currently monitoring our license use with a new rest-service I am implementing when I noticed my licenses on my instance being consumed and never released by Visual Studio Code.

For this I restarted my Instance, watched the licenses for a while, which remained at 1 during idle (I am guessing my MMGT Portal session uses 1) 
But when I connect to my Instance using Visual Studio Code (with my Instance setup in the extension already), suddenly 2 licenses are used. (I am guessing 1 for the "studio" and 1 for a terminal session, so far so good) 

0
0 0
Article Brett Saviano · Dec 21, 2023 2m read

Have you ever been editing files in VS Code, but needed to check a global value or run a few ObjectScript commands? Now you can, with no setup required! If you have vscode-objectscript extension version 2.10.0 or later and are connected to InterSystems IRIS 2023.2 or later, you can now open a terminal connection to your server, regardless of where it's located.

There are three ways to open this new terminal:

1
8 1588
Article Evgeny Shvarov · Feb 26 1m read

Hi colleagues!

Yet another time I figured that there is no super-simple way to display error from %Status variable, but I need it relatively often in a terminal.

Yes, I know about $$$ Macro, but they are not superhelpful in a terminal.

My usual behavior is to try to remember by heart or copy from somewhere the formula:

USER>w $System.Status.DisplayError(st)

0
0 0
Question Evgeny Shvarov · Feb 21

Hi folks!

I'm building a very simple REST API.

But before testing it via a Web Server what I want to make sure that REST API methods work in principle.

Is it an easy way to "fake" the web-server request and get a result e.g. of the method with signature like that?

ClassMethod GetAllRecords(pRequest As %CSP.Request, pResponse As %CSP.Response) As %Status

e.g. calling it in Terminal?

0
0 0
Question Dmitrii Baranov · Dec 10, 2024

I am developing locally on my IRIS instance using VSCode and client-side editing approach. How can I automatically export a single .cls file/a whole package to a remote TEST/PREPROD server using a script or command line and recompile the unit remotely? Are there any more simple and straightforward ways than CI/CD explained in the series of articles by Eduard?

0
0 0
Article Dmitry Maslennikov · Sep 25, 2024 1m read

We have Webterminal around for quite a while, but it was limited, not all features worked there. There was no shell support or the latest feature as embedded Python support. There are some issues with tools that require programmer mode. Basic Authorization, not as handy as simple login page, where you could have options to add own login page, in case if you would wish to change the way how to login to the application, such as using SSO.

0
0 0
Article Rodolfo Moreira dos Santos · Sep 25, 2024 3m read

Hi everyone,

In this article, I’m excited to introduce CodeInspector, a tool designed to simplify code validation by applying custom rules tailored to your development requirements. Whether you're managing a large codebase or working in an agile environment, CodeInspector helps ensure code quality by offering flexibility and adaptability to specific project needs.

Motivation

0
0 0
Article Robert Cemper · Sep 12, 2024 2m read

During testing the added Multi-Namespace feature I met a challenge
that required intervention. This simple request created 1000 lines of output.

USER>do^rcc.find
----------------
 
enter search string [$ZU] <blank> to exit:
          Verbose? (0,1) [0]:
          Force UpperCase? (1,0) [1]:
 
enter code type (CLS,MAC,INT,INC,ALL) [ALL]:
 
select namespace (ALL,%SYS,DOCBOOK,ENSDEMO,ENSEMBLE,SAMPLES,USER) [USER]: all
  • As for the verbose variant you my run a log on your terminal to keep the result in details
  • though a real summary was still missing.
0
0 0
Question Hannah Sullivan · Aug 14, 2024

If anyone has experience debugging Embedded Python or has insight into why an ObjectScript method when called from a Python method would not work but would work when called directly via ObjectScript or in a Python shell, your help would be appreciated! 

We have an ObjectScript ClassMethod called GetTemplateString() which takes in a templateName of String type and uses the template name to get the template object, access the Code, and read the code into a templateString. The string version of the Code is returned.

0
0 0
Question Andy Stobirski · Jun 6, 2024

Hi

I have a question about terminal, when I run a class from it that contains an error I get a report of error as I would expect, and then an apparently random three letter code is appended to the namespace name in the prompt, as shown below.

GMMHTIE>do ##class(temp.Nothing).What()
 
 w !, tParisAnswer
      ^
<UNDEFINED>zWhat+23^temp.Nothing.1 *tParisAnswer
GMMHTIE 2d1>

Then, when I try to enter a command I get an error

GMMHTIE 2d1>do ##class(temp.Nothing).What()
 
DO ##class(temp.Nothing).What()
^
<COMMAND>^temp.Nothing.1
GMMHTIE 2d1>

0
0 0
Question David Marinkovic · Apr 23, 2024

Hello everyone,

I have an issue related to Visual Studio Code and its InterSystems extension when exporting routines from the database to the file system.

The code entered via the terminal editor is encoded in DOS code page 437, but when I export it to my file system, even if I set the file opening to DOS CP 437, the accented characters which are two bytes long cause problems.

0
0 183
Article Megumi Kakechi · Apr 18, 2024 1m read

InterSystems FAQ rubric

When you run a routine in the terminal and an error occurs in the program, if you have not set the error trap properly, the program will enter debug mode as shown below.

USER>do^error1
 write A
^
a+2^error1 *A
USER 2d0>

From this state, enter the Quit command to return to the state before the routine was started.

USER 2d0>Quit

If a transaction is being processed within the routine where the error occurred, a prompt similar to the one below will appear.

USER>do^error1
 write A
^
a+3^error1 *A
TL1:USER 2d0>q
TL1:USER>
0
0 199
Question Pietro Di Leo · Apr 17, 2024

Hello everybody, 

I've been experimenting with Embedded Python and have been following the steps outlined in this documentation: https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cl…

I'm trying to convert a python dictionary into an objectscript array but there is an issue with the 'arrayref' function, that is not working as in the linked example.

This is a snapshoot of my IRIS terminal: 

0
0 199
Article Theo Stolker · Jan 15, 2024 1m read

I though this is a pretty cool way of installing webterminal in an environment where I had Management Portal / Visual code access, but I had no terminal access. zpm was already present. otherwise you could add it in the same class.

  1. Create the following class file
  2. Compile. This will take a while, and then you will see the output from zpm!
  3. You can now open the webterminal by opening http://your-host/terminal/
Class Theo.Util.Webterminal Extends %RegisteredObject
{

/// Description
ClassMethod install() As %Status [ CodeMode = objectgenerator ]
{
    zpm "install webterminal"
}

}
2
1 394
Article David.M · Sep 7, 2016 5m read

HealthShare uses a lot of XSLTs. These are used to convert IHE medical documents to SDA (internal HealthShare format) and back to IHE formats, to create summary reports, and to deal with IHE profiles (e.g., patient information query, document provide and register). Customers may customize the XSLTs to customize reports or for other reasons.

For debugging and development, it is very convenient to be able to run an XSLT from Terminal.

The Class Method

1
4 1555
Question Lukasz Migacz · Feb 19, 2024

Hi,

I have an odd problem that occurs when I'm trying to import lookup tables in the XML format into Studio.

I store my files in in C:\CodeRepository.

I can manually import these lookup tables using "Import local..." option in the InterSystems Studio. 

However, when I'm trying to import them using command in terminal: do $system.OBJ.LoadDir("C:\CodeRepository\","ck")

I'm getting the following error:

0
0 202
Article Elijah Tamarchenko · Feb 8, 2024 2m read

Interacting with Users in the Terminal: A Guide to Using %Library.Prompt in IRIS

 

Have you ever wondered how commands like ^DATABASE engage users in the terminal? Or perhaps you're writing an automation routine and want ways to specify options directly from the terminal. Thankfully, the %Library.Prompt class in IRIS offers a straightforward way to do so!

String Input

For basic input, such as asking the user to provide a filepath or namespace, use the following code:

set status = ##class(%Library.Prompt).GetString("Input filepath:", .path)
0
0 307
Article Evgeny Shvarov · Jan 25, 2024 2m read

Hi Devs!

Recently I was impressed by @Dan Pasco's article where he shares also how he uses terminal aliases. 

Terminal aliases is a very powerful tool for developers and sys admins if you often need to call some cumbersome terminal expressions and make it shorter and cleaner. Here is the documentation.
Yes! 

But what about Docker environments? What if you are fan of Docker dev environments but also want to keep using your favorite aliases with Docker as well?

Turned out it is very possible.

12
0 305