Encontrar

ディスカッション
· 2025年12月14日

开发者社区10岁了!欢迎您分享与社区的精彩难忘瞬间

亲爱的开发者们,值此十周年庆典之际,我们诚邀请您参与一场讨论,回顾您在 InterSystems 开发者社区的体验与经历

过去十年间,成千上万的成员通过知识共享、协作,以及有意义的联系,共同塑造了这个空间,您的声音是这段历史不可或缺的一部分。

我们鼓励您加入对话,分享您的故事。请在评论中告诉我们:

1️⃣ 您何时加入开发者社区,以及最初是如何发现它的。
2️⃣ 在这段旅程中,您所经历过的一个有意义的时刻或故事
3️⃣ 您认为特别有价值的一篇文章、一个问题或一次讨论——您认为值得其他人花时间认真回顾的内容。

您的反思有助于凸显社区多年来所产生的影响,激励社区的未来发展。

感谢您参与这一里程碑事件,并为开发者社区的成功做出贡献!

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
質問
· 2025年12月14日

Macroses with variable number of optional arguments

Hi,

I need a simple function for formatting a string, like in Python or C#. That's easy:

Class Very.Very.Long.Class.Name
{
ClassMethod Format(fmt As %String, args...) As %String [ Language = python ]
{
return fmt.format(*args)
}
}

To simplify calls, I want to wrap the function into a macro:

3 Comments
ディスカッション (3)2
続けるにはログインするか新規登録を行ってください
記事
· 2025年12月12日 2m read

Archivos temporales y Singletons: limpiad lo que generéis.

Hay un patrón con el que me he encontrado varias veces en el que necesito usar un archivo o carpeta temporal y que se limpie en algún momento más adelante.

Lo natural aquí es seguir los patrones de "Robust Error Handling and Cleanup in ObjectScript" usando un try/catch/pseudo-finally o un objeto registrado para gestionar la limpieza en el destructor. %Stream.File* también tiene una propiedad “RemoveOnClose” que podéis activar… pero usadla con cuidado, porque podríais eliminar accidentalmente un archivo importante, y este indicador se reinicia al llamar a %Save(), así que tendréis que volver a ponerlo a 1 después de hacerlo.

Pero hay un caso complicado: imaginad que necesitáis que el archivo temporal sobreviva en un nivel de pila superior. Por ejemplo:

ClassMethod MethodA()
{
    Do ..MethodB(.filename)
    // Do something else with the filename
}

ClassMethod MethodB(Output filename)
{
    // Create a temp file and set filename to the file's name
    Set filename = ##class(%Library.File).TempFilename()
    
    //... and probably do some other stuff
}

Siempre podríais pasar objetos %Stream.File* con RemoveOnClose puesto a 1, pero aquí realmente estamos hablando solo de archivos temporales.

Aquí es donde entra el concepto de “Singleton”. En IPM tenemos una implementación base en %IPM.General.Singleton que podéis extender para cubrir distintos casos de uso. El comportamiento general y el patrón de uso son:

  • En un nivel de pila superior, llamáis a %Get() en esa clase y obtenéis la única instancia, que también será accesible mediante llamadas a %Get() en niveles inferiores.
  • Cuando el objeto sale de ámbito en el nivel de pila más alto que lo usa, se ejecuta el código de limpieza.

Esto es un poco mejor que usar una variable %, porque no necesitáis comprobar si está definida, y además sobrevive a los NEW sin argumentos en los niveles de pila inferiores gracias a cierta magia profunda de objetos.

Pasando a los archivos temporales, IPM también tiene un singleton gestor de archivos temporales. Aplicándolo a este problema, la solución es:

ClassMethod MethodA()
{
    Set tempFileManager = ##class(%IPM.Utils.TempFileManager).%Get()
    Do ..MethodB(.filename)
    // Do something else with the filename
    // The temp file is cleaned up automatically when tempFileManager goes out of scope
}

ClassMethod MethodB(Output filename)
{
    Set tempFileManager = ##class(%IPM.Utils.TempFileManager).%Get()
    // Create a temp file and set filename to the file's name
    Set filename = tempFileManager.GetTempFileName(".md")
    
    //... and probably do some other stuff
}
ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
お知らせ
· 2025年12月12日

[Video] SQL Tricks and Tips

Hey Community!

We're happy to share a new video from our InterSystems Developers YouTube:

⏯  SQL Tricks and Tips @ Ready 2025

This presentation introduces two helpful SQL features in InterSystems IRIS: Common Table Expressions (CTEs) and Limit/Offset. CTEs, available since version 24.1, let users simplify complex queries by breaking them into reusable, readable blocks that can be used with SELECT, INSERT, UPDATE, and DELETE statements.
The Limit/Offset feature, added in version 25.1, provides a flexible alternative to the TOP clause, allowing users to limit returned rows and skip specific records, ideal for pagination. Together, these features make queries easier to write, read, and optimize, while the SQL engine automatically handles efficient execution and plan optimization.

Presenters:
🗣 Ismail Ben Atitallah, Principal Systems Developer, InterSystems
🗣 Yiwen Huang, Systems Developer, InterSystems

Enjoy watching, and subscribe for more videos! 👍

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください
お知らせ
· 2025年12月12日

[Video] Enhancing Customer Engagement with Vector Search - Building a Customer Facing Chatbot

Hey Developers,

Enjoy the new video on InterSystems Developers YouTube

⏯ Enhancing Customer Engagement with Vector Search - Building a Customer Facing Chatbot @ READY 2025

Explore how InterSystems IRIS vector search anchors chatbot capabilities by delivering fast, relevant, and context-aware responses. In this session, we’ll walk through the key benefits and best practices for using vector search in conjunction with your LLM to power your chatbots. You’ll also meet our new chatbot AskMe, available on our documentation and learning sites; it’s designed to help you find answers quickly and navigate content with ease. Whether you’re building AI-driven support or optimizing existing solutions, you’ll leave with actionable insights to improve and enhance self-service experiences.

Presenters:
🗣 @Brenna Quirk, Sr. Technical Online Course Developer at InterSystems
🗣 @Jim Breen, Director of Global Learning at InterSystems
🗣 @Kim Koehler, Manager, Learning Technology at InterSystems 

Enjoy watching, and look forward to more videos!👍

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください