Table creation/Postal addresses: Difference between revisions
Content added Content deleted
No edit summary |
m (→version 1: simplified some code, added/changed comments and whitespace, arranged subroutines into alphabetical order, corrected some characters used for boxen.) |
||
Line 876: | Line 876: | ||
parish, country, etc) could be added without exclusion. |
parish, country, etc) could be added without exclusion. |
||
<br>A logging facility is included which tracks who (by userID) did what update (or change), along with a timestamp. |
<br>A logging facility is included which tracks who (by userID) did what update (or change), along with a timestamp. |
||
<pre> |
|||
<lang>╔════════════════════════════════════════════════════════════════════════════════╗ |
|||
╔═════════════════════════════════════════════════════════════════════════════════╗ |
|||
╟───── Format of an entry in the USA address/city/state/zip code structure: |
╟───── Format of an entry in the USA address/city/state/zip code structure: ──────╢ |
||
║ ║ |
║ ║ |
||
║ The "structure" name can be any legal variable name, but here the name will be ║ |
|||
║ |
║ The "structure" name can be any legal variable name, but here the name will be ║ |
||
║ shortened to make these comments (and program) easier to read; its name will ║ |
|||
║ be @USA (in any letter case). In addition, the following variable |
║ be @USA (in any letter case). In addition, the following variable names ║ |
||
║ (stemmed array tails) will need to be kept uninitialized (that is, not used ║ |
║ (stemmed array tails) will need to be kept uninitialized (that is, not used ║ |
||
║ for any variable name). To that end, each of these variable names will have an║ |
|||
║ |
║ for any variable name). To that end, each of these variable names will have an ║ |
||
║ |
║ underscore in the beginning of each name. Other possibilities are to have a ║ |
||
║ trailing underscore (or both leading and trailing), or some other special eye─ ║ |
|||
⚫ | |||
║ |
║ catching character such as: ! @ # $ ? ║ |
||
⚫ | |||
║ Any field not specified will have a value of "null" (which has a length of 0).║ |
║ Any field not specified will have a value of "null" (which has a length of 0). ║ |
||
║ ║ |
║ ║ |
||
║ Any field can contain any number of characters, this can be limited by the ║ |
|||
║ |
║ Any field can contain any number of characters, this can be limited by the ║ |
||
║ |
║ restrictions imposed by the standards or the USA legal definitions. ║ |
||
║ Any number of fields could be added (with testing for invalid fields). ║ |
|||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
⚫ | |||
║ |
║ @USA.0 the number of entries in the @USA stemmed array. ║ |
||
║ |
║ ║ |
||
║ nnn is some positive integer of any length (no leading zeroes). ║ |
|||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
║ @USA.nnn._name is the name of person, business, or a lot description. ║ |
║ @USA.nnn._name is the name of person, business, or a lot description. ║ |
||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
║ @USA.nnn._addr is the 1st street address ║ |
|||
║ @USA.nnn. |
║ @USA.nnn._addr is the 1st street address ║ |
||
║ @USA.nnn. |
║ @USA.nnn._addr2 is the 2nd street address ║ |
||
║ @USA.nnn. |
║ @USA.nnn._addr3 is the 3rd street address ║ |
||
⚫ | |||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
║ @USA.nnn._state is the USA postal code for the state, |
║ @USA.nnn._state is the USA postal code for the state, territory, etc. ║ |
||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
║ @USA.nnn._city is the official city name, it may include any character. ║ |
║ @USA.nnn._city is the official city name, it may include any character. ║ |
||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
║ @USA.nnn._zip is the USA postal zip code |
║ @USA.nnn._zip is the USA postal zip code (five or ten digit format). ║ |
||
╟────────────────────────────────────────────────────────────────────────────────╣ |
|||
╟─────────────────────────────────────────────────────────────────────────────────╢ |
|||
║ @USA.nnn._upHist is the update history (who, date and timestamp). |
║ @USA.nnn._upHist is the update history (who, date, and timestamp). ║ |
||
╚════════════════════════════════════════════════════════════════════════════════╝</lang> |
|||
╚═════════════════════════════════════════════════════════════════════════════════╝ |
|||
⚫ | |||
</pre> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
call USA '_city' , 'Boston' |
|||
⚫ | |||
⚫ | |||
call USA ' |
call USA '_city' , 'Boston' |
||
call USA ' |
call USA '_state' , 'MA' |
||
call USA ' |
call USA '_addr' , "51 Franklin Street" |
||
call USA '_name' , "FSF Inc." |
|||
call USA ' |
call USA '_zip' , '02110-1301' |
||
@usa.0=@usa.0+1 /*bump the unique number for usage. */ |
|||
⚫ | |||
call USA ' |
call USA '_city' , 'Washington' |
||
call USA ' |
call USA '_state' , 'DC' |
||
call USA ' |
call USA '_addr' , "The Oval Office" |
||
call USA ' |
call USA '_addr2' , "1600 Pennsylvania Avenue NW" |
||
call USA ' |
call USA '_name' , "The White House" |
||
call USA '_zip' , 20500 |
|||
⚫ | |||
/*────────────────────────────────────────────────────────────────────────────*/ |
|||
exit /*stick a fork in it, we're all done. */ |
|||
⚫ | |||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
call tell '_addr' |
|||
do j=2 until $==''; call tell "_addr"j; end /*j*/ |
|||
call tell '_city' |
|||
⚫ | |||
⚫ | |||
⚫ | |||
/*────────────────────────────────────────────────────────────────────────────*/ |
|||
say copies('─', 40) |
|||
⚫ | |||
⚫ | |||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
|||
⚫ | |||
⚫ | |||
/*────────────────────────────────────────────────────────────────────────────*/ |
|||
⚫ | |||
⚫ | |||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
|||
call tell '_addr' |
|||
⚫ | |||
⚫ | |||
⚫ | |||
call tell '_city' |
|||
else do |
|||
⚫ | |||
⚫ | |||
call value @ || @usa.0 || . || 'upHist', userid() date() time() |
|||
say copies('─', 40) |
|||
⚫ | |||
return</lang> |
return</lang> |
||
'''output''' (data used is within the REXX program): |
'''output''' (data used is within the REXX program): |