Re: ASCAN problems?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Yeah, that was it alright. I could have sworn I used that combination
already. Guess not.

Thanks for the help Dan,
Linn

"Dan Freeman" <spam@xxxxxxxxxxxxx> wrote in message
news:uPyRqgFdGHA.3952@xxxxxxxxxxxxxxxxxxxxxxx
ASCAN() is picky as hell.

Your ALEN() is returning the number of *elements* but because you're
searching in a specific column only, you want the number of *rows*. i.e.
ALEN(.aStatus,1)

Dan

Linn Kubler wrote:
Hi,

Running VFP 9.0 and I'm trying to use ASCAN() to search an array.
This is a two dimensional array property of a form. What I want to
do is scan the second column so I tried using the command like this:
with thisform
l=ASCAN(.aStatus, .lpStatus,1,ALEN(.aStatus), 2)
endwith

When I run my form I get an error stating that the subscript is
outside defined range. If I take off the last parameter it works
fine but I'm searching the entire array, not just column two. Even
if I change it to a 1 for the first column it gives the same error.
Is this a bug in the ASCAN() function? The help file shows basically
the same example except I'm finding the end of the arry dymanically
with the alen() function.

The help file also says that you can omit the starting element and the
number of elements to search but I'm not sure how you'd do that
either. Should I just leave blank place holders in the command like
this? =ASCAN(.aStatus, .lpStatus, , , 2)

If I simply use: =ASCAN(.aStatus, .lpStatus) it works so I my array
and the property thisform.lpStatus are correct.

Thanks in advance,
Linn




.



Relevant Pages

  • RE: How to manage around 1000 entries which will constantly bechanging
    ... For each combination produced by script, ... of this array is <100, then a "new" result is automatically added. ... searching a sorted array. ... =head1 SYNOPSIS ...
    (perl.beginners)
  • Re: Tree ADT vs Database
    ... I mention Big-O notation because it ... For example, accessing an array takes Otime, ... searching requires Ovs O ... normal form, would you expect searching to be quicker than a simple ...
    (comp.lang.java.programmer)
  • Re: ASCAN problems?
    ... searching in a specific column only, you want the number of *rows*. ... Running VFP 9.0 and I'm trying to use ASCAN() to search an array. ... The help file also says that you can omit the starting element and the ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Query
    ... prepared in chronological order, then each call could be assigned to ... an array of 10 variables. ... "closed" in the array before searching for the first open line for the ... Tom Ellison ...
    (microsoft.public.access.queries)
  • Re: How to manage around 1000 entries which will constantly be changing
    ... the array is left unsorted. ... array compare to resorting on every update and searching a sorted array. ... Below is the algorithm I was talking about. ... =head1 SYNOPSIS ...
    (perl.beginners)