Page 1 of 1
How to serach in mutildemension array alone with ASCAN() ?
Posted: Sun Sep 19, 2010 4:18 am
by huangchenmin

Hi everyone:
There are an 4x3 array, in which 4 rows and 3 columns. Columns represent NAME,CUSTOM_ID,TEL.
How to serach corresponding cell match in array alone with ASCAN(). Following are my code.
TEXTBOX named PFID_Keyin got a value from user.
ASCAN(a_curlist,form_upload.PFID_Keyin.Value)
ASCAN() returns 0 all the time. What is going wrong ?
By the way , why Type(form_upload.PFID_Keyin.Value) returns N even 『DATATYPE CHARACTER』 was seted up ?
Best Regards
chen min
Re: How to serach in mutildemension array alone with ASCAN()
Posted: Sun Sep 19, 2010 1:34 pm
by huangchenmin
huangchenmin wrote:
Hi everyone:
There are an 4x3 array, in which 4 rows and 3 columns. Columns represent NAME,CUSTOM_ID,TEL.
How to serach corresponding cell match in array alone with ASCAN(). Following are my code.
TEXTBOX named PFID_Keyin got a value from user.
ASCAN(a_curlist,form_upload.PFID_Keyin.Value)
ASCAN() returns 0 all the time. What is going wrong ?
By the way , why Type(form_upload.PFID_Keyin.Value) returns N even 『DATATYPE CHARACTER』 was seted up ?
Best Regards
chen min
I found the answer!
The code should be like following.
ASCAN(a_curlist,{|a_arg|a_arg[m_arg01]==m_key4seek})
HMG will performing code block with every element of array, and the code block returns .T. when element matchs the m_key4seek. Meanwhile ASCAN returns row when code block returns .T.. m_arg01 represents the column of array.
That 's all!