It was originally an input loop, and I forgot to change that. As it stands,
there's no functional difference between an "if" and a "while" in that spot.

Adrian Anderson

Cherokee Services Group (CSG)
Contracted To:
U.S. Geological Survey
Fort Collins Science Center
2150 Centre Ave., Bldg C
Fort Collins, CO 80526
Phone: 970-226-9189
E-mail: aanderson@usgs.gov


On Thu, Jan 23, 2014 at 2:16 PM, Eric Martinez <notifications@github.com>wrote:

> In scripts/convert_nehrp_sql.perl:
>
> > +# Figure out the edition, and input and output file names.
> > +my $filename = "$ARGV[0]";
> > +my $filename_out = $filename;
> > +$filename_out =~ s/\.[0-9a-zA-z]+$/\.sql/;
> > +if ($ARGV[3]) { $filename_out = $ARGV[3]; }
> > +print "\n";
> > +print "Writing to $filename_out.\n";
> > +
> > +# Open files.
> > +open(BFILE, $filename) or die "Cannot open binary file for reading.\n";
> > +my $bfile_size = -s $filename;
> > +open(OUTFILE, ">", $filename_out) or die "Cannot open output file for writing.\n";
> > +
> > +# Get edition.
> > +my $edition = trim($ARGV[1]);
> > +while ($edition ne "" && $edition ne "nehrp-2015" && $edition ne "asce_41-2013,1e" && $edition ne "asce_41-2013,2e" &&
>
> Why is this a while loop instead of an if? If the while condition is met,
> the program exits, if not, the while loop terminates. Seems like "if" would
> do the job here.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/usgs/earthquake-usdesign/pull/3/files#r9130153>
> .
>