Nesting Functions
Darren Reely
darren_reely@latticesemi.com
Thu, 17 Jun 1999 14:17:06 -0700
Try
define z2 char*11 = RJ(ASCII(X)[1:10])[1:8] + "." +
RJ(ASCII(X)[1:10])[9:2]
I made Z2 one character longer to fit in the decimal.
Darren
Terry Pickering wrote:
>
> 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????????
>
> Terry Pickering CompuGroup, Inc.
> pickering@myself.com Portland, Oregon USA
> www.teleport.com/~compugrp Cessna 172 & Lancair ES = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 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.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.