Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Half adjust in free format

Status
Not open for further replies.

Reaper73

Programmer
Jun 20, 2005
11
US
Can you half adjust in free format without using the EVAL statement?
 
Reaper73,

Nope. You have to use the Eval(H) syntax.

HTH,
MdnghtPgmr
 
Actually, you can use the %DECH built-in function. You have to specify the length and the number of decimal places for the field, though. But you can "soft-code" it, so if the field attributes change, you don't have to remember to change the statement:

Code:
NumField = %DECH(a / b : %LEN(NumField): %DECPOS(NumField));

Me transmitte sursum, Caledoni!

 
But you can't use %len and %decpos within the %dec BIF, right?
So you need to create constants. Same result.

D NumField_LEN C %len( NumField )
D NumField_DEC C %decPos( NumField )

Numfield = %decH( a / b: NumField_LEN: NumField_DECP );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top