Field Names in Processing Trick
bobsimcoe at adelphia.net
bobsimcoe at adelphia.net
Mon Nov 13 12:37:06 PST 2006
Hi
I must have missed this if it was on the list before, but today I found I could assigned a variable, FldName, to hold the Field Name as it appears in Define Files. @wef*, I could prompt the user a each field with the Field Name( starting at Field 4). In my example that follows, I'm prompting the user to Enter the Name, Address and so on at each particular field, when adding a new customer to the customer file. The file has 61 fields, so this saved me lots of typing. Also, using the selection set, called b1browse, displays a different prompt if the user is in fields, 31,39,42,43, and 45, save more typing.
Sorry about the odd characters in the example below.
Hope this might be helpful.
Bob Simcoe
1 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: end ?
2 ------- - - - - - - - - - - - - - - - -
@wef* ? If: ?
Then: FldNumber = @fd ?
3 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: FldName = fieldname( - , FldNumber ) ?
4 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: gosub eprompt ?
5 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: end ?
6 ------- - - - - - - - - - - - - - - - -
@wlf* ? If: @sk eq "save" ?
Then: gosub saveit ; close ; exit
7 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: end ?
8 ------- - - - - - - - - - - - - - - - -
eprompt? If: ?
Then: cls("21") ?
9 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: showctr("24") "\K4 To Record, \KY To Cancel, \KJ For Help" ?
10 ------- - - - - - - - - - - - - - - - -
? If: b1browse 'prompt for @wef's 31,39,41,42,43 ?
Then: showctr("21") "\KB to Select from Browse" ; return ?
11 ------- - - - - - - - - - - - - - - - -
? If: 'else ?
Then: showctr("21") "Enter " < FldName ; return ?
12 ------- - - - - - - - - - - - - - - - -
? If: ?
Then: return ?
+-------------------------+ 5
¦ D E F I N E F I L E S ¦
+-------------------------+
Number -------------Field Heading-------------- Len --Type-
1 - MasterCustNo ? 6? rjfill0
2 - IntCustNo ? 6? rjfill0
3 - CreateDate ? 10? mdyy/
4 - Customer Number ? 10? allup
5 - Customer Name ? 35? allup
6 - Address Line 1 ? 35? allup
7 - Address Line 2 ? 35? allup
8 - Address Line 3 ? 35? allup
9 - City ? 20? allup
10 - State ? 2? stprov
11 - Zip Code ? 10? zipna
12 - County ? 25? allup
13 - WebSite Address ? 70? *
14 - A/P Contact ? 35? uplow
15 - A/P Phone ? 14? phone
etc.
More information about the Filepro-list
mailing list