Nesting Functions

Terry Pickering pickering@myself.com
Thu, 17 Jun 1999 13:50:51 -0700


Consider the following code (I hope it aligns correctly in your email reader):


DEFINE X INT*8 = 12345

DEFINE Y CHAR*10 = ASCII(X)


DEFINE Z1 CHAR*10 = RJ(Y)

DEFINE Z2 CHAR*10 = RJ(ASCII(X))


REPORT X Y Z1 Z2



It produces the following results:


      X      Y           Z1          Z2


      12345  12345            12345  12345


My basic question is why doesn't the results of Z2 the same as Z1? What I want is a right justified character field containing a number (no leading zeroes - that's cheating). I also want to do it without doing a two step define, but instead with functions in one step. I don't see anything in the manual that says you can't combine these two functions together, but it sure doesn't appear to let you do it.




What I'm trying to do is display in a QUICK INFO statement, a numeric field with two implied decimal places, something like this:


INFO = "Amount:" + ASCII(X)[1:8] + "." + ASCII(X)[9:2] 


INFO statement would then display:

Amount:     123.45



I can get it to work if I do it this way:


INFO = "Amount:" + ASCII(X,10)[1:8] + "." + ASCII(X,10)[9:2] 


But then the INFO statement displays:

Amount:00000123.45



Any suggetions????????



<color><param>0000,0000,8080</param>Terry Pickering                      
  CompuGroup, Inc.

pickering@myself.com                    Portland, Oregon USA

www.teleport.com/~compugrp              Cessna 172 & Lancair ES</color>
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.