The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

42s program question
Message #1 Posted by David Persinger (US) on 8 Aug 2012, 2:10 p.m.

Can someone tell me what function is being referred to when there is |-? in a program listing. I understand the append function |- But what is the question mark following it?

Thanks.

      
Re: 42s program question
Message #2 Posted by Matt Agajanian on 8 Aug 2012, 2:14 p.m.,
in response to message #1 by David Persinger (US)

Are you speaking of programs here in the MoHPC Software Library?

            
Re: 42s program question
Message #3 Posted by David Persinger (US) on 8 Aug 2012, 2:18 p.m.,
in response to message #2 by Matt Agajanian

yes. Actual line is.

18 |-?": > "

it is in a program called PRM? for evaluating if a number is prime and putting the factors in a 1xN matrix.

      
Re: 42s program question
Message #4 Posted by David Persinger (US) on 8 Aug 2012, 3:01 p.m.,
in response to message #1 by David Persinger (US)

This same program uses the test:

x!=y?

I am not sure what this is supposed to be either. If I enter x=y? or x<>y?, the program returns an incorrect response.

Is there a list of programming conventions someplace for when the program step is represented by non-keyboard characters?

for example Rdn vs. Roll down, because there is no down arrow character?

            
Re: 42s program question
Message #5 Posted by Diego Diaz on 8 Aug 2012, 5:05 p.m.,
in response to message #4 by David Persinger (US)

Hi David,

The "|-" symbol represents the ALPHA append function: whatever is between quotation marks after the "|-" symbol will be appended to the right of the ALPHA register contents.

To get this append character into your program just activate ALPHA mode en hit ENTER key.

Note that in the line 18 |-?": > ", the question mark "?" is a typo?: it must not be entered, just enter 18 |-": > "

x!=y? is the x<>y? sometimes represented as x#y?: Is x different from y?

The "!=" (not equal to) comparison operator is fairly common in early "C" language machines.

Hope this helps.

Cheers.

Diego.

Edited: 8 Aug 2012, 5:24 p.m.

                  
Re: 42s program question
Message #6 Posted by David Persinger (US) on 9 Aug 2012, 6:34 a.m.,
in response to message #5 by Diego Diaz

Thanks Diego.

I figured the ? was a typo. I tried not equal to for != but the program didn't work. But I was able to figure out which inequality test does.

Thanks for the response!

David


[ Return to Index | Top of Index ]

Go back to the main exhibit hall