Anonymous user
File extension is in extensions list: Difference between revisions
File extension is in extensions list (view source)
Revision as of 13:08, 24 November 2019
, 4 years ago→{{header|REXX}}: changed some variable names and comments.
Alextretyak (talk | contribs) (Added 11l) |
m (→{{header|REXX}}: changed some variable names and comments.) |
||
Line 1,517:
=={{header|REXX}}==
This REXX version handles the extra credit requirement.
<lang rexx>/*REXX
$= 'zip rar 7z gz archive A## tar.bz2'; upper $ /*a list of "allowable" file extensions*/
parse arg fn /*obtain optional argument from the CL.*/
@.= /*define the default for the @. array.*/
if fn\='' then @.1 = strip(fn)
else do; @.1 = "MyData.a##" /*No " "
@.2 = "MyData.tar.Gz"
@.3 = "MyData.gzip"
Line 1,531:
@.8 = "MyData_v1.0.bz2"
end
#= words($)
do j=1 while @.j\==''; @@= @.j; upper
▲ x=. || word($, k) /*construct the extension of the file. */
end /*k*/ /* [↓] display file, and a nay or yea.*/
say right(@.j, 40) ' ' right( word( "false true", 1 + (k<=#) ), 5)▼
▲ say right(@.j, 40) ' ' right( word( "false true", 1 + (k<=#) ), 5)
end /*j*/ /*stick a fork in it, we're all done. */</lang>
{{out|output|text= when using the default input:}}
|