Page 1 of 15
Edit Extended / Edit WorkArea - ABM / ABM2
Posted: Sun Mar 15, 2009 4:52 am
by CCH4CLIPPER
Hi Escigi/Rathinagiri
Take a look at this function :-
Code: Select all
function EditXARDATA
LOCAL aFldNames:={}
if open_ar()
/* this also cannot compile "unbalanced delimiters" ??
aFldnames[fcount()]
AFIELDS(afldnames)
*/
aFldNames:=('SHORT_NAME','CUSTOMER','CONTACT')
EDIT EXTENDED ;
WORKAREA ARDATA ;
FIELDNAMES afldnames ;
TITLE 'Maintain Customer Profile' ;
TABLEVIEW {.T.,.T.,.F.}
endif
return
Q. In the aFldnNames array, I have specified only 3 fields (there are 20 fields).
However, the result is that all 20 fields are displayed by this powerful command
Am I missing something ?
CCH
http://cch4clipper.blogspot.com
Re: EXTENDED EDIT
Posted: Sun Mar 15, 2009 10:15 am
by esgici
Hi CCH
aFldNames:= { 'SHORT_NAME','CUSTOMER','CONTACT' }
Regards
--
Esgici
Re: EXTENDED EDIT
Posted: Sun Mar 15, 2009 11:04 am
by sudip
Hi,
Yes, there was a careless mistake in the code.
I am also facing a similar problem regarding Edit Extended:-
I have a table dbtr.dbf. It has many fields. From them I want to edit only 3 fields. I Wrote following command. And it shows all fields. Can you please tell me, where I did a mistake? (I am sure there is a mistake, but both CCH and I couldn't figure out it)
EDIT EXTENDED;
WORKAREA DBTR ;
TITLE "Customer" ;
FIELDNAMES {"dbtrcd", "dbtrnm", "addr3"} ;
FIELDMESSAGES {"Customer Code", "Customer Name", "Address 3"} ;
FIELDENABLED {.t., .t., .t.}
With best regards.
Sudip
Re: EXTENDED EDIT
Posted: Sun Mar 15, 2009 11:25 am
by esgici
Hi Sudip & CCH
IMHO, EDIT EXTENDED use FIELDNAMES parameter for EDIT window only. In browse, use ALL fields by default.
Regards
--
Esgici
Re: EXTENDED EDIT
Posted: Sun Mar 15, 2009 11:36 am
by sudip
Hi Esgici,
Thank you very much for help.
I just tested it with the code (3 fields). It shows all fields in Browse as well as in Edit windows
I am sure I made some mistake. But, I can't figure out where.
With best regards.
Sudip
Re: EXTENDED EDIT
Posted: Sun Mar 15, 2009 12:20 pm
by esgici
Hi Sudip & CCH
Sorry,
EDIT EXTENDED use FIELDNAMES parameter for EDIT window only. In browse, use ALL fields by default.
isn't correct ( I am not a good user of EDIT EXTENDED
).
Simply we have use FIELDENABLED ( for edit window ) and /or TABLEVIEW ( for browse ) parameters for field selection.
Argument of this two parameter is an array with logical values and length is FCOUNT().
F.e: For select ( enable ) first three fields of a six fields table :
Code: Select all
FIELDENABLED { .T., .T., .T., .F., .F., .F. } ;
TABLEVIEW { .T., .T., .T., .F., .F., .F. }
That's all.
Regards
--
Esgici
Re: EXTENDED EDIT
Posted: Sun Mar 15, 2009 12:49 pm
by sudip
Hi Esgici,
Thanks a lot for clarification!
Regards.
Sudip
Re: EXTENDED EDIT
Posted: Mon Mar 16, 2009 12:26 pm
by CCH4CLIPPER
Hi Escigi
TQVM for your valuable feedback.
Full syntax :-
EDIT EXTENDED
[ WORKAREA ]
[ TITLE ]
[ FIELDNAMES ]
[ FIELDMESSAGES ]
[ FIELDENABLED ]
[ TABLEVIEW ]
[ OPTIONS ]
[ ON SAVE ]
[ ON FIND ]
[ ON PRINT ]
As I have mentioned in Clipper... Clipper... Clipper,
" BTW, you should note that FIELDNAMES/FIELDENABLED/TABLEVIEW will only work if an array of ALL fields are specified."
Also, I could not get FIELDMESSAGES to work.
Regards
CCH
http://cch4clipper.blogspot.com
Re: EXTENDED EDIT
Posted: Mon Mar 16, 2009 1:28 pm
by esgici
Hi CCH
CCH4CLIPPER wrote:
..., you should note that FIELDNAMES/FIELDENABLED/TABLEVIEW will only work if an array of ALL fields are specified.
Or more precisely :
in the
Code: Select all
...
[ FIELDNAMES <acFieldNames> ]
[ FIELDMESSAGES <acFieldMessages> ]
[ FIELDENABLED <alFieldView> ]
[ TABLEVIEW <alTableView> ]
...
syntax, <acFieldNames>, <acFieldMessages>, <alFieldView> and <alTableView> are arrays in FCOUNT() length (size).
Also, I could not get FIELDMESSAGES to work.
"Messages" ( field description ) in the FIELDMESSAGES <acFieldMessages> are displayed in Status Bar when record editing or adding.
Regards
--
Esgici
edit extended
Posted: Wed Mar 17, 2010 1:52 pm
by t57042
When working with EDIT with a shared dbf and trying to update the same record at the same time from 2 applications over a network I sometimes get a message that the record cannot be reached (it is locked or the file is locked). This is wanted and normal.
When I try the same with EDIT EXTENDED I can not force that message. Is this due to the fact that I do not update at the same time or is the behavior of EDIT and EDIT EXTENDED different regarding locking?
Richard