>>>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.
>>
>>? dbf()
>>
>>will display the name of the table
>>being opened in current area, blank
>>if no table opened.
>>
>>? used()
>>
>>return true if a table is opened
>>in current area. Check the on-line help
>>for more information about them.
>
>...and don't forget
ALIAS()>
>best
Thanks All, I think
Alias() is best here.
Because Actually it is not why I donno what currect work area is,
I make a general grid class will some make some decision on init()..
If there is no work area before call that form, problem comes...
Maybe I can say what I want: I want to make a grid with IME fixed and
change it with txtnumber textbox for numeric value!(download from file section!)
Grid.no_ime() Code here:
if !empty(alias())
nFieldCount = AFields(CFields)
* the command will make dbf file open dialog if no alias in current work area!
Endif
with this
local i
if .ColumnCount > 0
for i = 1 to .ColumnCount
.Columns[i].RemoveObject("Text1")
COLCS = .Columns[i].CONTROLSOURCE
DO CASE
CASE TYPE("&COLCS") $ "NY"
IF THIS.NORMALNUM = .T.
.Columns[i].AddObject("Text1", "txt")
ELSE
.Columns[i].AddObject("Text1", "txtnumber")
.Columns[i].Text1.InputMask = Repl("#", cFields[i,3]-1) + "9"
if cFields[i,4] > 0
.Columns[i].Text1.InputMask = .Columns[i].Text1.InputMask + ;
"." + Repl("9", cFields[i,4])
endif
ENDIF
CASE TYPE("&COLCS") $ "D"
.Columns[i].AddObject("Text1", "txtdate")
OTHERWISE
.Columns[i].AddObject("Text1", "txt")
ENDCASE
.Columns[i].Text1.Visible = .T.
.Columns[i].Text1.BorderStyle = 0
.Columns[i].Text1.SpecialEffect = 1
.Columns[i].Sparse = .F.
endfor
endif
endwith
So, the grid will get all benefit on numeric, date fieldtype as change to approiate object in run-time!
because I need to reset the txtnumber InputMask in run-time according to numeric field decimal place, I need to test for it....
Therefore, I donno which field is numeric but ensure it will get right display especially for integer field... (With Decimal will make the grid ugly!)
Since I will also reset the grid.recordsource and recreate the column objects again... I need to call this proc again and again in run-time...
Anyway, it is fixed now! ^-^;
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.