× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I *think* the problem is that #FLD contains the field name as a literal value e.g. #FLD = 'LOC1' and Loc(count#) is the value of the data in the field (not the name of the field, which is what I want to compare to).

Yes, that's exactly what's happening.


So rather than using Loc(Count#) perhaps I should use something like 'LOC' + %char(count#) which would render to LOC1 when count = 1.

So If #FLD = 'LOC' + %char(count#); may work.

Yes, that'll work... but perhaps a better solution is to do something like this:

      FldName = %subst(FLD#:1:3);
      FldIndex = %int(%subst(FLD#:4:1));

      if FldName = 'LOC'
         and FldIndex>=1 and FldIndex<=10;
           // do whatever
      endif;

The advantage is that if you want the value of the field that the user selected, you can just do:

      Value = Loc(FldIndex);


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.