Table creation/Postal addresses: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed indentation, comments. -- ~~~~)
Line 523: Line 523:
│ @USA.nnn._upHist = update History (who, date and timestamp). │
│ @USA.nnn._upHist = update History (who, date and timestamp). │
└────────────────────────────────────────────────────────────────────┘*/
└────────────────────────────────────────────────────────────────────┘*/
@USA.=''; @USA.0=0
@USA.=; @USA.0=0


@usa.0=@usa.0+1 /*bump the unique number for use.*/
@usa.0=@usa.0+1 /*bump the unique number for use.*/
Line 539: Line 539:
call @USA '_name',"The White House"
call @USA '_name',"The White House"
call @USA '_zip',20500
call @USA '_zip',20500

call @USA 'list'
call @USA 'list'
exit /*stick a fork in it, we're done.*/
exit
/*───────────────────────────────@USA subroutine────────────────────────*/
/*───────────────────────────────@USA subroutine────────────────────────*/
@USA: procedure expose @USA.; parse arg what,txt; arg ?; nn=@usa.0
@USA: procedure expose @USA.; parse arg what,txt; arg ?; nn=@usa.0
Line 548: Line 547:
call value '@USA.'nn".upHist",userid() date() time()
call value '@USA.'nn".upHist",userid() date() time()
end
end
else do nn=1 for @usa.0
else do nn=1 for @usa.0
call @USA_list
call @USA_list
end
end /*nn*/
return
return
/*───────────────────────────────@USA_tell subroutine-------------------*/
/*───────────────────────────────@USA_tell subroutine───────────────────*/
@USA_tell: _=value('@USA.'nn"."arg(1));
@USA_tell: _=value('@USA.'nn"."arg(1));
if _\=='' then say right(translate(arg(1),,'_'),6) "==>" _
if _\=='' then say right(translate(arg(1),,'_'),6) "──►" _
return
return
/*───────────────────────────────@USA_list subroutine-------------------*/
/*───────────────────────────────@USA_list subroutine───────────────────*/
@USA_list:
@USA_list: call @USA_tell '_name'
call @USA_tell '_name'
call @USA_tell '_addr'
do j=2 until _==''
call @USA_tell '_addr'
call @USA_tell '_addr'j
do j=2 until _==''
end /*j*/
call @USA_tell '_addr'j
call @USA_tell '_city'
end
call @USA_tell '_city'
call @USA_tell '_state'
call @USA_tell '_state'
call @USA_tell '_zip'
say copies('',40)
call @USA_tell '_zip'
return</lang>
say copies('-',40)
'''output''' (data used is within the REXX program):
return</lang>
<pre style="overflow:scroll">
Output (data used is within the REXX program):
name ──► FSF Inc.
<pre style="height:40ex;overflow:scroll">
addr ──► 51 Franklin Street
name ==> FSF Inc.
city ──► Boston
addr ==> 51 Franklin Street
state ──► MA
city ==> Boston
zip ──► 02110-1301
state ==> MA
────────────────────────────────────────
zip ==> 02110-1301
name ──► The White House
----------------------------------------
name ==> The White House
addr ──► The Oval Office
addr2 ──► 1600 Pennsylvania Avenue NW
addr ==> The Oval Office
city ──► Washington
addr2 ==> 1600 Pennsylvania Avenue NW
state ──► DC
city ==> Washington
zip ──► 20500
state ==> DC
────────────────────────────────────────
zip ==> 20500
----------------------------------------
</pre>
</pre>