The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Why does this Friday 13th program fail?
10-16-2017, 02:02 PM (This post was last modified: 10-16-2017 02:02 PM by Joe Horn.)
Post: #1
Why does this Friday 13th program fail?
Perusing old postings I ran across several "Friday The 13th" programs, and whipped up this obvious-ware for the HP Prime. Looks to me like it should work. But it doesn't.

Code:
EXPORT FRI13(Y)
BEGIN
LOCAL j;
L9:={};
FOR j FROM Y+.0113 TO Y+.1213 STEP .01 DO
IF DAYOFWEEK(j)==5 THEN L9:=CONCAT(L9,j);
END;
RETURN L9;
END;
END;

An input of 2017 should return {2017.0113, 2017.1013}, but it only returns {2017.0113}.

An input of 2026 should return a list containing 3 dates, but only an empty list is returned.

What am I doing wrong?

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Why does this Friday 13th program fail? - Joe Horn - 10-16-2017 02:02 PM



User(s) browsing this thread: 5 Guest(s)