Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

$%LOWER

Draft MDC Standard

1 CHARACTER Library
1.3 LOWER

Editor’s note:
Recommend to use $QSubscript to find the value of y.
The first subscript of ^$Global must be a string that starts with "^", and that character is explicitly removed from the value that is being used.
LOWER(A,CHARMOD) New lo,up,x,y
	;
	; The code below was approved in document X11/1998–21
	;
	Set x=$Get(CHARMOD)
	Set lo="abcdefghijklmnopqrstuvwxyz"
	Set up="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	If x?1"^"1E.E Do
	. Set x=$Extract(x,2,$Length(x))
	. If x?1"|".E Do
	. . Set x=$REverse($Extract(x,2,$Length(x)))
	. . Set y=$REverse($Piece(x,"|",2,$Length(x)+2))
	. . Set x=$REverse($Piece(x,"|",1))
	. . Set x=$Get(^|y|$GLOBAL(x,"CHARACTER"))
	. . Quit
	. Else  Set x=$Get(^$Global(x,"CHARACTER"))
	. Quit
	If x="" Set x=^$Job($Job,"CHARACTER")
	Set x=$Get(^$Character(x,"LOWER"))
	If x="" Quit $TRanslate(A,up,lo)
	Set @("x="_x_"(A)")
	Quit x
Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 14-Nov-2023, 21:44:36.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)