Re: Programming using 4GL (max days)
Posted in 1993
Ruchi Patel <RUCHI%CFRVM.BITNET@uga.cc.uga.edu> writes: > > > Is there any way I can find out maximum days for the current month? > > e.g 4/5/93 - April has 30 days > > Thanks. > Within 4GL you could try: main define d date, m, m1 int let d = today let m = month(d) let m1 = m while (m1 = m) let d = d + 1 let m1 = month(d) end while let d = d - 1 display d using "mmm yyyy", " has ", d using "dd", " days" end main Or, using unix utilities (if you have them): cal `date '+%m %y'`| awk '{ if (NR == 1) { whatmon = $1 whatyear = $2 } if ($0 != "") numdays = $NF } END {print whatmon, whatyear, "has", numdays, "days"} *-------------------------------------------------------------------------* | Colin McGrath E-Mail: colin@scdipc0.ueci.com | | Raytheon Engineers & Constructors Inc. Voice : 215-422-3449 | | 30 S. 17th St FAX : 215-422-3363 | | Philadelphia, Pa, USA | *-------------------------------------------------------------------------*