|
Okay, for this to work you will need to loop through your 11 elements and set them to ' ' before you populate the array, are you doing this? Every cycle through? And, did you sort your array before you called the LookUpGT ? And, are you sure that the data that is populating the array actually is greater than ' '? On a PC I know that ' ' is ASCII 32, and that almost all other characters are greater than it, 'a', 'A', etc... Regards, Jim Langston -----Original Message----- From: JMoore@nycm.com [mailto:JMoore@nycm.com] Has anyone noticed any strange results with using the %LookUp Built In Function under V5R1? I have an array (defined as ErrorCodes S 1 Dim(11) Inz Ascend) which I am loading with various codes for error reporting purposes. If the array is empty no errors were found on the input record, and I want to process that record. I originally used the following logic to determine if the ErrorCodes array was empty... If %LookUpGt(' ':ErrorCodes) > 0 Write Error Eval ErrorCount = ErrorCount + 1 EndIf I found that sometimes this logic would work and other times it would not... I tried changing the code as follows: Eval Index = %LookUpGt(' ':ErrorCodes) If Index > 0 Write Error Eval ErrorCount = ErrorCount + 1 EndIf Again, sometimes this worked, sometimes it didn't... I also tried changing the BIF like so %LookUpGt(' ':ErrorCodes:1:11) to start the search from the 1st array element through the 11th. It didn't solve my problem... I have even stepped through a debug session and watched the array being loaded, yet an error report record was never written... In the first example I stepped from the If to the EndIf. In the second example Index was zero... Is it just my code or does the %LookUp BIF have a "bug" in it??? Thank you John Moore
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.