Examples of %DH

Example:

	GTM>DO INT^%DH 
	Decimal: 12
	Digits: 1
	GTM>ZWRITE 
	%DH="C"		
	

This example invokes %DH interactively with INT^%DH. %DH prompts for a decimal number and output length, then returns the result in the variable %DH. ZWRITE displays the contents of the variables.

Example:

	GTM>SET %DH=12
	GTM>DO ^%DH
	GTM>ZWRITE
	%DH="0000000C"
	%DL=8		
	

This example sets the read-write variable %DH to 12 and invokes %DH to convert the number to a hexadecimal number. Because the number of digits was not specified, %DH used the default of 8 digits. Set %DL to specify the number of output digits.

Example:

	GTM>WRITE $$FUNC^%DH(12,4)
	000C
	

This example invokes %DH as an extrinsic function using the FUNC label. The first argument specifies the input decimal number and the optional, second argument specifies the number of output digits. If the extrinsic does not have a second argument, the length of the output defaults to eight characters.