Replies:

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
 

Open Exchange applications:
Certifications & Credly badges:
Global Masters badges:
Followers:
Following: