Post Reply 
DUP n "erzats"
03-10-2016, 02:31 PM
Post: #10
RE: DUP n "erzats"
(03-10-2016 08:19 AM)ggauny@live.fr Wrote:  HP said "if a function miss you, then do it your self" !

Sure - and on the 34s this can be done very elegantly as there are local registers. Several standard functions are actually regular user code programs in XROM.

(03-10-2016 08:19 AM)ggauny@live.fr Wrote:  I have put #011, because the first iteration don't count, it is not like in loop
Start Next. So if I put #012 I calculate for 13 months.

Try it. ;-) For instance with 2012: the loop checks 13.122012 down to 13.022012 for a Friday but it does not try 13.012012 ...which *is* a Friday.

The version I posted in the "Back on Forum" thread runs 12 loops. And it detects 13.012012 as another Friday in its final loop.

Some programming tips that may be useful here:

– The program is supposed to return up to three dates on the stack. This is no problem with the original 50G version (unlimited stack, several levels visible), but on the 34s it requires SSIZE8.

– The 34s does not require a division by 10^6. Simply use SDR 006 – that command exists exactly for cases like this.

– The program detemines the weekday by calculating the number of days between the current date and 4.043000 (which is a Friday). The 34s has a dedicated WDAY command, so this may be the better choice here.

– If you use a flag test, always make sure the flag has a defined state at program start. In your example you cannot be sure that flag 00 is initially clear. So add a CF 00 right at the start.

– The method I suggested for DUP 0 / DUP 1 does not require any flags. ;-)

(03-10-2016 08:19 AM)ggauny@live.fr Wrote:  In the past I was writed to Tim that it would be very well that HP Prime understand ALL HP LANGUAGES,

"All" is quite a lot. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DUP n "erzats" - ggauny@live.fr - 03-08-2016, 12:22 PM
RE: DUP n "erzats" - Dieter - 03-08-2016, 07:53 PM
RE: DUP n "erzats" - Didier Lachieze - 03-08-2016, 08:13 PM
RE: DUP n "erzats" - Dieter - 03-08-2016, 09:28 PM
RE: DUP n "erzats" - jch - 03-08-2016, 09:01 PM
RE: DUP n "erzats" - ggauny@live.fr - 03-09-2016, 12:45 PM
RE: DUP n "erzats" - Dieter - 03-09-2016, 03:20 PM
RE: DUP n "erzats" - Dieter - 03-09-2016, 09:19 PM
RE: DUP n "erzats" - ggauny@live.fr - 03-10-2016, 08:19 AM
RE: DUP n "erzats" - Dieter - 03-10-2016 02:31 PM
RE: DUP n "erzats" - ggauny@live.fr - 03-11-2016, 07:21 AM



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