Table creation/Postal addresses: Difference between revisions

m
→‎{{header|REXX}}: changed indentation, comments. -- ~~~~
m (→‎{{header|REXX}}: changed indentation, comments. -- ~~~~)
Line 523:
│ @USA.nnn._upHist = update History (who, date and timestamp). │
└────────────────────────────────────────────────────────────────────┘*/
@USA.=''; @USA.0=0
 
@usa.0=@usa.0+1 /*bump the unique number for use.*/
Line 539:
call @USA '_name',"The White House"
call @USA '_zip',20500
 
call @USA 'list'
exit /*stick a fork in it, we're done.*/
exit
/*───────────────────────────────@USA subroutine────────────────────────*/
@USA: procedure expose @USA.; parse arg what,txt; arg ?; nn=@usa.0
Line 548 ⟶ 547:
call value '@USA.'nn".upHist",userid() date() time()
end
else do nn=1 for @usa.0
call @USA_list
end /*nn*/
return
/*───────────────────────────────@USA_tell subroutine-------------------subroutine───────────────────*/
@USA_tell: _=value('@USA.'nn"."arg(1));
if _\=='' then say right(translate(arg(1),,'_'),6) "==>──►" _
return
/*───────────────────────────────@USA_list subroutine-------------------subroutine───────────────────*/
@USA_list: call @USA_tell '_name'
call @USA_tell '_name_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 '_addr_city'
end
call @USA_tell '_city_state'
call @USA_tell '_state_zip'
say copies('-',40)
call @USA_tell '_zip'
return</lang>
say copies('-',40)
Output'''output''' (data used is within the REXX program):
return</lang>
<pre style="height:40ex;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
----------------------------------------
nameaddr ==>──► The WhiteOval HouseOffice
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>