>>many command such as skip, afields(), need current working area.
>>but how can I know the area is exist table/view/cursor or nothing at all.
>
>
>I'm not sure exactly what you're asking, but as your english is so much better than my chinese, I will answer what I think you are asking.
>
>1) If you're asking "how can I know there is a table/view/cursor (something) in the current work area" you would issue:
>if !empty(alias())
> Skip...
>else
>
>2) If you are asking "how can I know if the current work area is a table, or a view, or a cursor", use
>nFileTytpe=CURSORGETPROP(SourceType)
>
>nFileTytpe=1 Specifies that the data source is a local SQL view.
>nFileTytpe=2 Specifies that the data source is a remote SQL view.
>nFileTytpe=3 Specifies that the data source is a table.
>
>3) If you're asking "What should I do if I don't know if the table is in the current workarea or if another table is active", try issuing :
>Skip in MyWorkArea
>
Thanks all, the first one is enough! or as Certin say,
with thisform.mygrid
if !empty(.recordsource)
nFieldCount = Afields(CurFields, .recordsource)
endif
endwith
I possibly put this question in wrong group, (Class vcx) is better.
In normal form and simple grid, it is easy to handle current work area,
Whereas a general reusable class will need more skillful technique.
>I hope this helps. and always remember...
>"I know you think you heard what you thought I said, but what you don't understand is that what you thought you heard is not what I think I meant"
>
>jt
jt...
"I know you said you meant what you told I heard, but I see how you show what I understand is that what I see I thought is not what you tell you point!"
8-)
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.