cancel
Teacher
Teacher
88 61 1 5
Message 1 of 8
924
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

HP 50g graphing calculator

Hello dear HP Support Community ,

 

I want to know if is possible to change an entering form without changing object type  or input format if I'm using INFORM command in HP 50g graphing calculator . I have a task to convert date in input format of day.month.year. into "decimal" years .

 

So as example if date was about 01.07.2030. ( random number ) my decimal years will be approximately 2030.50 , If you use similar method you can change a time or angle in hours°minutes'seconds" format to decimal format od those quantity !!

 

But real deal happens when I tred to type that what I mean beyond this text , so If you follow me I want to type date 28. Of March 2019. in format which i described before ( day.month.year.) when I call INFORM command to take a place , but you know I'm getting an error in the end ...

 

I will show you basic three steps what I want to do when I mean "changing input format"15537909321008032718248657997394.jpgNext ... step is when I press enter I get this notification ... It suggest me thath is something wrong

 

15537908273883517837238978821552.jpgFirst step ... input form , I'm using current date in Croatia ... 28.03.2019.

Please look at these pictures from below to the top !!

 

I think I had a problem when I want to post pictures , 

So Can enyone suggest me a solution for this , If you did not understand I will recap all of this ,

1. I want to enter numbers in specific format just like you see before and without changing object type , you probably know that you can type 28.03.2019. by putting this double quotes " " on beggining and at the end of my expression but I want to type numbers in format like you probably see in the pictures 28.03.2019. without "28.03.2019." and converting from string to number or whatever else . Just few numbers I want to enter in a specific format and that's all !! :OpenSmile:

2. Basicly all that I need i explain in first part , second part is all about how to succesfull convert from that format ( day.month.year. ) to decimal years 

3. Part is most simpliest and I want to know how to save decimal years.

 

I hope that you understand me , keep this three guidlines in mind and If is possible please reply to my question .

Thank you very much !! 

 

Best regards ,

 

Josip Kova 

 

7 REPLIES 7
PhD Student
PhD Student
500 487 79 144
Message 2 of 8
897
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

Your posting's title says that it's about the INPUT command, but your posting talks about the INFORM command. Please clarify which one you want to use. Thank you.

-Joe-
Reply
0 Kudos
Teacher
Teacher
88 61 1 5
Message 3 of 8
892
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

Yeah , I did not really noticed that so far , 

Thanks for your attention Joe , 

I thought about INFORM command , not INPUT but i think that I make a mistake and instead of INFORM a wrote INPUT .

Maybe I made such mistake because I was thinking on INPUT more than INFORM .

 

If you know how to do that with INFORM it will be very nice , because INFORM command is my priority number one not Input , but if someone know how to make same thing with the INPUT command , freely write and post your solution .

 

But this time I'm only refering to INFORM command .

 

Sorry for misunderstanding , It's my fault this time :LaughingTears:

If you know how to use both method , that will be definitely much better and if you have time and will describe how to solve this challenge with both INFORM and INPUT , that will be cool :Sunglasses: :Glasses:

Reply
0 Kudos
PhD Student
PhD Student
500 487 79 144
Message 4 of 8
848
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

Unless I'm mistaken, getting a string input from INFORM will require the user to press the " " key.  The second argument of INFORM can specify that the input be a string object, but that doesn't change the input into a string, it merely verifies that the input was indeed a string, and if not, it generates an error.  So I'm sorry, your goal of not pressing the " " key doesn't seem to be possible if you want a string output in the form of "08.19.1955." from INFORM.

 

However, the INPUT command does allow string inputs without requiring the user to press the " " key.  Furthermore, INPUT is probably more appropriate for your intended purpose anyway, since it is intended for single inputs, whereas INFORM is optimized for multiple simultaneous inputs.

 

Example in RPN mode: "DY.MO.YEAR" "" INPUT --> returns whatever the user types, in string form.

 

For further info about the INPUT and INFORM commands, please refer to the Advanced User's Reference Manual, which not only gives their complete syntax with all their options, but even has a whole section in the Programming chapter about them, beginning on page 1-37.

 

 

-Joe-
Reply
0 Kudos
Teacher
Teacher
88 61 1 5
Message 5 of 8
843
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

Dear Joe ,

Thank you for your reply to my question about this !! So , basicly that means that I really can't do what I intend to do in my case with INFORM , but anyway I can do same thing with INPUT !!

 

That is my personal conclusion about that :Sunglasses:

 

Thank you for your solution although I think that I can somehow change my input format by using a INFORM , but it is quite obviously that I can't ,

 

I will accept your solution Joe , :OpenSmile:

 

Thanks !! 

 

Best regards ,

 

Josip Kova

Reply
0 Kudos
PhD Student
PhD Student
500 487 79 144
Message 6 of 8
832
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

Just a thought: One way to use INFORM to accomplish what you want is to specify that the input be in ISO format, namely, the number YYYYMMDD with no periods or dashes.  So 19 August 1955 would be input as 19550819.  One very real benefit of doing it this way is that the program can easily extract the three parts in an RPL program by simply doing 100 IDIV2 SWAP 100 IDIV2 SWAP. This leaves the year, month, and day, on stack levels 1, 2, and 3, respectively.

-Joe-
Teacher
Teacher
88 61 1 5
Message 7 of 8
799
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

Dear Joe ,

Great I'm glad that you find some solution to this problem ( or challenge ) !!

But can you also tell me what exactly I need to do in order to proceed that task in INFORM command or maybe if you had example because I tried to use your function and I get several question like "num. mode off ?" and so on .

 

I can't quite remember all questions , and at the end I get some type of global variable I don't remember a name I think that is 'IDIV' but I'm not quite sure .

 

I'm so glad that you had some solution although I mark your previous post with "accept solution" , too early , I know :LaughingTears:

 

Thank you for your interests for this post :Glasses:

 

Best regards ,

 

Josip Kova

Reply
0 Kudos
PhD Student
PhD Student
500 487 79 144
Message 8 of 8
789
Flag Post
HP Recommended

Solved!

Can I change input format for INPUT command in HP 50g graphing calculator ?

If you are getting 'IDIV' on the stack, you didn't type what I wrote above.  IDIV2 is a single command; there is no space between IDIV and 2.

 

Here's a bare-bones simple example of using INFORM to input a date. Type this program exactly as shown (ignoring carriage returns, of course), save it into a variable (use any name you wish), and run it.  Then try modifying it to use the other options of the INFORM command.

 

« "Enter Date"

{{"YYYYMMDD" "" 0}}

{ } { } { } INFORM

GET 100 IDIV2 SWAP 100 IDIV2 SWAP »

 

Output: Year, month, day, on stack levels 1, 2, 3, respectively.

-Joe-
Reply
0 Kudos
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation