User bio
my video https://youtu.be/zx6WoApljBI
my story https://community.intersystems.com/post/45-years-intersystems-1978-2023
Member since Jul 21, 2017
Posts:
Replies:
My guess:
- It was the WINNER of the video contest: https://www.youtube.com/watch?v=ZW5_Un0sYUw
- Also with no refence to video or article on OEX https://openexchange.intersystems.com/package/DNA-sequence-Gene-finder
#2)
Every LOCK persists until the process is ended or the LOCK is removed explicitely (LOCK -....)
it is not related to any error handling.
#1)
depends on your design.
If there is no conflict of subscripts between ADD and REMOVE possible there is no need of a Lock
Open Exchange applications:
Certifications & Credly badges:
Global Masters badges:
Followers:
Following:
Hi @Jeffrey Drumm ;
different approach: use your own datatype that always returns fixed MAXLEN string:
/// Make fixlength String according to MAXLEN parameter Class rcc.GetFix Extends %Library.String { /// Fill value <var>%val</var> to <a href="#MAXLEN">MAXLEN</a> characters. Method Get() As %String [ CodeMode = generator, ServerOnly = 1 ] { set code="$e(%val_"""_$j("",+%parameter("MAXLEN")) set code=code_""",1,"_+%parameter("MAXLEN")_")" $$$GENERATE( " Quit "_code) QUIT $$$OK } }
and a test class:
Class rcc.FixTest Extends %RegisteredObject { Property test As rcc.GetFix(MAXLEN = 12); }
and now some check from terminal:
SAMPLES>set z=##class(rcc.FixTest).%New() set z.test="rob" SAMPLES>write z.test,$L(z.test) rob 12 SAMPLES>;some oversized string SAMPLES>set z.test=";some oversized string" SAMPLES>write z.test,$L(z.test) ;some oversi12 SAMPLES>
Hope this helps you along