Nouvelle publication

検索

Question
· Juil 4, 2024

Responsividade de dados em aplicações no terminal.

Bom dia. Comecei a estudar o Caché a menos de um mês, de lá pra cá testei várias funcionalidades mas há uma que eu não consegui encontrar. Como posso fazerem meus dados serem responsivos quando representados em tabelas no terminal?

Exemplo (dados fictícios):

 

Atualmente eu resolvi este problema por meio de um algoritmo que consiste em ter uma string que tem a quantidade de espaços igual a quantidade de colunas do terminal, um dado (como por exemplo o nome) e uma substring da primeira que tem um tamanho igual a quantidade de caracteres delimitada para aquele campo subtraída da quantidade de caracteres do dado em si.

Exemplo:

Obviamente esta solução não é boa por vários motivos, primeiro que se mudar o tamanho do terminal ela já não funciona em si. Segundo que se o tamanho do dado for superior ao tamanho delimitado para o campo a responsividade quebra. Então se souberem como posso fazer para deixar os dados de maneira responsiva sempre, ficaria agradecido.

1 Comment
Discussion (1)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Juil 4, 2024 2m de lecture

ファイルに入力された文字列をバイト単位で読み込む方法

これは InterSystems FAQ サイトの記事です。

InterSystems製品のサーバサイドでファイル入出力を行うと、文字列はシステムで設定されたファイル入出力用文字コードに自動変換され、文字単位でREADします。

ファイルから入力する文字をバイト単位で操作するためには、自動変換を行わない無変換の状態でファイル入力を行い指定バイトずつ読みながら読んだ分だけUnicodeに手動で変換していく必要があります。

変換には$ZCONVERT()関数を使用します。($ZCONVERT()には省略形があり$ZCVT()でも同様の操作が行えます。)

なお、READした指定バイトを変換する際、文字の全バイトが含まれない場合もあるため、途中までの読み取りになった文字列を第4引数に指定する変数に設定できるようになっています。
次回読み取り時に途中だった文字を自動的に先頭に追加し、$ZCONVERT()の処理を実行します。

《メモ》ファイル入出力の文字コードについては、以下管理ポータルの画面で確認できます。
管理ポータル > 構成 > 国際言語設定 > 構成したデフォルト値
 入力/出力テーブルの表の「ファイル」

以下の文章がファイルにUTF8で保存されているとします。

2024/4/19:強風でしたが良い天気でした

 

無変換でファイル入力を行うには、%Stream.FileBinaryクラスを使用してファイルをオープンします。

5バイトずつ入力する例は以下の通りです。

set fb=##class(%Stream.FileBinary).%New()
write fb.LinkToFile("c:\temp\memoU.txt")  //ファイルをリンクできると1が返ります。
set data=fb.Read(5) // 5バイトずつREAD
//UTF8からUnicodeに変換するため第2引数は"I"を指定します
// 第3引数はUTF8(大文字)を指定し、第4引数に変数hadleを指定します。
//write $ZCONVERT(data,"I","UTF8",handle)," - ",handle
//EndOfFileを検出するとAtEndプロパティに1が設定されることを利用してループします。
while (fb.AtEnd=0) { set data=fb.Read(5) write $ZCONVERT(data,"I","UTF8",handle)," - ",handle,! }

kill fb  //ファイルをクローズします

While文に含まれるWRITE文の出力結果は以下の通りです。

2024/ -
4/19 - ï
:強 -
風 - ã
でし - ã
たが -
良 - ã
い天 - æ
気で -
し - ã

 - 
Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Annonce
· Juil 4, 2024

[Vídeo] Presentación de InterSystems Supply Chain Orchestrator

Hola Comunidad, 

Tenéis disponible un nuevo vídeo (en inglés) en el Canal de YouTube de InterSystems:

⏯ Presentación de InterSystems Supply Chain Orchestrator @ Global Summit 2023

Aprended qué contiene InterSystems Supply Chain Orchestrator. Descubrid cómo se puede utilizar para optimizar las cadenas de suministro y proporcionar información prescriptiva procesable. A través de presentaciones y una demostración en vivo de las capacidades clave del producto, aprenderéis por qué acelera el tiempo de creación de valor para la transformación digital de la cadena de suministro.

Ponentes:
🗣 @Ming Zhou, Head of Supply Chain Strategy, InterSystems
🗣 @Annie Tong, Supply Chain Sales Engineer, InterSystems

¡Disfrutadlo y estad atentos a más vídeos! 👍

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Question
· Juil 3, 2024

Testing XML input to Router Management Portal or via XML document viewer

Trying to test a router that takes an XML input and performs a transform on it.

First attempt I tried to test the transform using the XML Document Viewer via the Ensemble -> Interoperate -> XML Document Viewer menu. The transform itself is working however I can not get the output to save to a file. I've made sure permissions are set correctly on the file. It simply doesn't output anything and I'm at a loss as to why.

As another method I also tried testing via Ensemble -> Test -> Business Hosts. Putting the file path/name as the source does not send any data. Again, I've made sure read permissions are set for the file.

I've been able to test using other methods, so I'm not concerned with actually being able to validate my transform so much as I'm now at a loss as to why the two above methods do not seem to work.

Has anyone else experienced similar issues, particularly with the XML Document Viewer method?

Thanks.

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Annonce
· Juil 3, 2024

[Video] Introducing InterSystems Supply Chain Orchestrator

Hey Community,

Play the new video on InterSystems Developers YouTube:

⏯ Introducing InterSystems Supply Chain Orchestrator @ Global Summit 2023

Learn what’s inside InterSystems Supply Chain Orchestrator. Discover how it can be used to optimize supply chains and provide prescriptive actionable insights. Via presentations and a live demo of key product capabilities, you'll learn why it accelerates time-to-value for supply chain digital transformation.

Presenters:
🗣 @Ming Zhou, Head of Supply Chain Strategy, InterSystems
🗣 @Annie Tong, Supply Chain Sales Engineer, InterSystems

Enjoy watching and look out for more video content! 👍

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer