Edit Extended / Edit WorkArea - ABM / ABM2

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
CCH4CLIPPER
Posts: 130
Joined: Tue Mar 03, 2009 8:59 am

Edit Extended / Edit WorkArea - ABM / ABM2

Post by CCH4CLIPPER » Sun Mar 15, 2009 4:52 am

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

User avatar
esgici
Posts: 4309
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 200 times
Been thanked: 71 times
Contact:

Post by esgici » Sun Mar 15, 2009 10:15 am

Hi CCH

aFldNames:= { 'SHORT_NAME','CUSTOMER','CONTACT' }

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
sudip
Posts: 1444
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 4 times

Post by sudip » Sun Mar 15, 2009 11:04 am

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
With best regards,
Sudip

User avatar
esgici
Posts: 4309
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 200 times
Been thanked: 71 times
Contact:

Post by esgici » Sun Mar 15, 2009 11:25 am

Hi Sudip & CCH

IMHO, EDIT EXTENDED use FIELDNAMES parameter for EDIT window only. In browse, use ALL fields by default.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

User avatar
sudip
Posts: 1444
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 4 times

Post by sudip » Sun Mar 15, 2009 11:36 am

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
With best regards,
Sudip

User avatar
esgici
Posts: 4309
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 200 times
Been thanked: 71 times
Contact:

Post by esgici » Sun Mar 15, 2009 12:20 pm

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
Viva INTERNATIONAL HMG :D

User avatar
sudip
Posts: 1444
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India
Has thanked: 4 times

Post by sudip » Sun Mar 15, 2009 12:49 pm

Hi Esgici,

Thanks a lot for clarification! :)

Regards.

Sudip
With best regards,
Sudip

CCH4CLIPPER
Posts: 130
Joined: Tue Mar 03, 2009 8:59 am

Post by CCH4CLIPPER » Mon Mar 16, 2009 12:26 pm

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

User avatar
esgici
Posts: 4309
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 200 times
Been thanked: 71 times
Contact:

Post by esgici » Mon Mar 16, 2009 1:28 pm

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
Viva INTERNATIONAL HMG :D

t57042
Posts: 148
Joined: Tue Mar 16, 2010 9:46 am
Location: belgium
Has thanked: 2 times
Been thanked: 4 times

Post by t57042 » Wed Mar 17, 2010 1:52 pm

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

Post Reply