Check for negative number
Jeff Harrison
jeffaharrison at yahoo.com
Fri May 21 18:28:12 PDT 2010
--- On Fri, 5/21/10, Tom Aldridge <toma at aldridgeinc.com> wrote:
> From: Tom Aldridge <toma at aldridgeinc.com>
> Subject: Check for negative number
> To: filepro-list at lists.celestial.com
> Date: Friday, May 21, 2010, 8:52 PM
> I have this subroutine that when
> exiting a browse lookup of inventory
> items, it checks to see if there are any orders of those
> items, i.e. a
> number gt zero in a field. Works great. If there are any,
> it asks if you
> want to clear those values.
>
> 154 chkord:::
> 155 ::kl(3,.0)="0":
> 156 ::lookup invo = ("inventory@"{dept(1))
> k=kl i=I -ng:
> 157 :not invo:return:
> 158 :gosub clrord; return:
>
> However, I also want to check if there any negative order
> amounts, i.e.
> "-1" up to -99. So I set the key (kl) to "-99" thinking
> that it would
> begin there and work up. Problem it always finds a record
> even if there
> are no records with orders.
>
> So then I tested it using "Scan for Records" and it finds
> the first
> record in the file. I suppose it's finding the first record
> with an
> empty order field?
>
> Anyway, I'm looking for a way to do a lookup from -99 to 99
> and
> reporting "not" if there are no records with an order value
> in the range
> abovea; and the converse if there is.
>
> The field is a 3,.0 and the index is on that field.
>
> Thanks
>
> Tom Aldridge
>
I'm not following. If you want to find a negative value why don't you use a lookup "lt" the value of "0" ?
If you want greater than zero, then do as you are doing now ("gt" a value of "0". Is your problem you want to do both at the same time (excluding the value of 0 and blank? If so I think you will need two lookups.
Good Luck
Jeff Harrison
Author of JHImport and JHExport. The fastest and easiest ways to import and export with filepro.
More information about the Filepro-list
mailing list