Post Reply 
Periodic Table program
04-08-2014, 11:15 PM
Post: #1
Periodic Table program
Can somebody please provide me with a working copy of the touch periodic table program for the HP Prime.

I have tried all the versions that I have been able to find yet none of them will work!

I get a syntax error in all of them and when I try to run I just get the "!" (exclamation mark) and nothing else happens.

I have read archived thread 21 and see that there was a program error in the file and it seems to still be there and I am not quite sure what needs to be done to correct this error.

Any help would be appreciated.

Carl
Find all posts by this user
Quote this message in a reply
04-08-2014, 11:32 PM
Post: #2
RE: Periodic Table program
Can you share the txt of the code you are using?

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
04-09-2014, 05:06 AM
Post: #3
RE: Periodic Table program
Try this version :
http://mic.nic.free.fr/hp/Touch%20elemen...0Prime.zip

To send the program :
[Image: send_hpprime.png]

http://mic.nic.free.fr - Youtube - Facebook
Find all posts by this user
Quote this message in a reply
04-09-2014, 07:36 PM
Post: #4
RE: Periodic Table program

.txt  HP_Elements.txt (Size: 11.72 KB / Downloads: 21) Thank you for the reply.

I have tried as you have shown but still have the same problem.

The program gives an exclamation mark and does nothing else, on both the emulator and the calculator.

Also get a syntax error in program line 120 message.

I have attached a text file of the code that I am using which is the code that I just downloaded from Mic.

Carl
Find all posts by this user
Quote this message in a reply
04-09-2014, 08:40 PM
Post: #5
RE: Periodic Table program
Which softwareversion is loaded in your calculator? Is it the November release?

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
04-09-2014, 08:48 PM
Post: #6
RE: Periodic Table program
I think this is just an old version of the program. I was able to get this version to work.

Hope this helps...

-Dave
Find all posts by this user
Quote this message in a reply
04-09-2014, 09:26 PM
Post: #7
RE: Periodic Table program
(04-08-2014 11:15 PM)CarlRay Wrote:  Can somebody please provide me with a working copy of the touch periodic table program for the HP Prime.

I have tried all the versions that I have been able to find yet none of them will work!

I get a syntax error in all of them and when I try to run I just get the "!" (exclamation mark) and nothing else happens.

I have read archived thread 21 and see that there was a program error in the file and it seems to still be there and I am not quite sure what needs to be done to correct this error.

Any help would be appreciated.

Carl

Hi Carl,

Please use this version. It has many bugs corrected:

1- extract the file that is in the zip file (file with a .hpprg extension)
2- copy the file to this windows folder:

C:\Users\[your user name]\AppData\Roaming\HP_Prime

3- start the Virtual Prime, so you can run the program.

Note:
-Be sure to not to be in the Spreadsheet APP, before running it.
-if you happen to use comma as the decimal separator, change it to dot and compile.
-The code in my post is a text just to demonstrate a scrolling building block.

Hope this helps

Miguel
Find all posts by this user
Quote this message in a reply
04-09-2014, 10:22 PM
Post: #8
RE: Periodic Table program
Thanks again for all the help.

My calculator software version is "2013 11 25 (5447), CAS version 1.1.0-27.

I am now able to get the two versions from above posts to run on the emulator but not the calculator.

When the files transfer to the calculator, the file size KB is different on the emulator then the calculator, ie; HP_Elements on emulator is 56KB yet only 26KB on the calculator.

Also, I do not have a C:\Users\[your user name]\AppData\Roaming\HP_Prime directory on my computer.

I have C:\Documents and Settings\Owner\Application Data\HP_Prime, which seems to have all the apps and programs in it!

No sign of a "Roaming" directory.

Carl
Find all posts by this user
Quote this message in a reply
04-09-2014, 11:08 PM
Post: #9
RE: Periodic Table program
(04-09-2014 10:22 PM)CarlRay Wrote:  Thanks again for all the help.

My calculator software version is "2013 11 25 (5447), CAS version 1.1.0-27.

I am now able to get the two versions from above posts to run on the emulator but not the calculator.

When the files transfer to the calculator, the file size KB is different on the emulator then the calculator, ie; HP_Elements on emulator is 56KB yet only 26KB on the calculator.

Also, I do not have a C:\Users\[your user name]\AppData\Roaming\HP_Prime directory on my computer.

I have C:\Documents and Settings\Owner\Application Data\HP_Prime, which seems to have all the apps and programs in it!

No sign of a "Roaming" directory.

Carl

Yes, it depends on the Windows version you have. In your case it is the second you stated. Be sure make a clean install: Get rid of any version you have on the emulator, close it and put the .hpprg file in C:\Documents and Settings\Owner\Application Data\HP_Prime, then call the emulator again and the program should be there.
Find all posts by this user
Quote this message in a reply
04-09-2014, 11:11 PM
Post: #10
RE: Periodic Table program
(04-09-2014 10:22 PM)CarlRay Wrote:  Thanks again for all the help.

My calculator software version is "2013 11 25 (5447), CAS version 1.1.0-27.

I am now able to get the two versions from above posts to run on the emulator but not the calculator.

When the files transfer to the calculator, the file size KB is different on the emulator then the calculator, ie; HP_Elements on emulator is 56KB yet only 26KB on the calculator.

Also, I do not have a C:\Users\[your user name]\AppData\Roaming\HP_Prime directory on my computer.

I have C:\Documents and Settings\Owner\Application Data\HP_Prime, which seems to have all the apps and programs in it!

No sign of a "Roaming" directory.

Carl

This might help you: http://www.hpmuseum.org/forum/thread-36.html
With the calculator connected just drag anything to the "Send" button
[Image: 04.09.2014-20.10.png]

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
04-09-2014, 11:51 PM
Post: #11
RE: Periodic Table program
Just look at me trilingual program (another one completely different) touch and joystick navigation at the same time : Programming with Spreadsheet in this forum



(04-08-2014 11:15 PM)CarlRay Wrote:  Can somebody please provide me with a working copy of the touch periodic table program for the HP Prime.

I have tried all the versions that I have been able to find yet none of them will work!

I get a syntax error in all of them and when I try to run I just get the "!" (exclamation mark) and nothing else happens.

I have read archived thread 21 and see that there was a program error in the file and it seems to still be there and I am not quite sure what needs to be done to correct this error.

Any help would be appreciated.

Carl


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
04-10-2014, 12:59 AM
Post: #12
RE: Periodic Table program
I have tried several times to get the Periodic Table Program to work on the actual Prime
without success. It works fine on the emulator. So the question, as stated by
the original post is: Has anyone been able to get this program to work on
the actual Prime?
I have a Prime with the most recent firmware updates and am using the most
recent version of Miguel's program.
There appears to be at least one syntax error in the program after it is loaded
to the actual Prime, preventing it from running. No errors on the emulator.
Find all posts by this user
Quote this message in a reply
04-10-2014, 01:39 AM
Post: #13
RE: Periodic Table program
(04-10-2014 12:59 AM)John Colvin Wrote:  I have tried several times to get the Periodic Table Program to work on the actual Prime
without success. It works fine on the emulator. So the question, as stated by
the original post is: Has anyone been able to get this program to work on
the actual Prime?
I have a Prime with the most recent firmware updates and am using the most
recent version of Miguel's program.
There appears to be at least one syntax error in the program after it is loaded
to the actual Prime, preventing it from running. No errors on the emulator.

Some things to check (whether it's this program or any other program):
1. After transferring to the calculator, make sure that you "recompile" the program WHILE NOT INSIDE THE SPREADSHEET APP. There is a known issue with respect to graphic buffers conflicting with cell names in the spreadsheet app.
2. In some versions, the source code does not properly declare one of the subroutines prior to calling it. It likely was not a problem on the author's calculator because he wrote both an English and French version using the same program names. Thus, any issues due to lack of declarations in one program will not show up if the other program already has a compiled version in memory. However, most users in English speaking countries will only have one of these versions downloaded and installed, so they will see this error.
3. Check to make sure that your settings are not causing the issues:
a) Hex mode (in some versions, the author did not explicitly include proper base suffices in integers -- i.e. #F vs #Fh makes a difference)
b) Comma / Decimal (for fraction mark) will also affect compilation

These items above apply to all programs, not just the periodic table program.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-10-2014, 01:57 AM
Post: #14
RE: Periodic Table program
(04-10-2014 01:39 AM)Han Wrote:  
(04-10-2014 12:59 AM)John Colvin Wrote:  I have tried several times to get the Periodic Table Program to work on the actual Prime
without success. It works fine on the emulator. So the question, as stated by
the original post is: Has anyone been able to get this program to work on
the actual Prime?
I have a Prime with the most recent firmware updates and am using the most
recent version of Miguel's program.
There appears to be at least one syntax error in the program after it is loaded
to the actual Prime, preventing it from running. No errors on the emulator.

Some things to check (whether it's this program or any other program):
1. After transferring to the calculator, make sure that you "recompile" the program WHILE NOT INSIDE THE SPREADSHEET APP. There is a known issue with respect to graphic buffers conflicting with cell names in the spreadsheet app.
2. In some versions, the source code does not properly declare one of the subroutines prior to calling it. It likely was not a problem on the author's calculator because he wrote both an English and French version using the same program names. Thus, any issues due to lack of declarations in one program will not show up if the other program already has a compiled version in memory. However, most users in English speaking countries will only have one of these versions downloaded and installed, so they will see this error.
3. Check to make sure that your settings are not causing the issues:
a) Hex mode (in some versions, the author did not explicitly include proper base suffices in integers -- i.e. #F vs #Fh makes a difference)
b) Comma / Decimal (for fraction mark) will also affect compilation

These items above apply to all programs, not just the periodic table program.
Thanks Han for the help. The program did not affix an h after the hex number entries.
I set the number mode to Hex and that fixed the problem.
Find all posts by this user
Quote this message in a reply
04-10-2014, 05:10 AM
Post: #15
RE: Periodic Table program
I think it is the connectivity kit which doesn't correctly send the big in size programs.
I must try several times when I send more than 10 KB programs.

http://mic.nic.free.fr - Youtube - Facebook
Find all posts by this user
Quote this message in a reply
04-10-2014, 05:36 AM
Post: #16
RE: Periodic Table program
(04-10-2014 05:10 AM)Mic Wrote:  I think it is the connectivity kit which doesn't correctly send the big in size programs.
I must try several times when I send more than 10 KB programs.

Yes, I forgot that one, too. The current connectivity kit sometimes misbehaves with "large" files.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-10-2014, 03:06 PM (This post was last modified: 04-10-2014 03:07 PM by orcinus.)
Post: #17
RE: Periodic Table program
Tiny tweak to Miguel's fork:
https://dl.dropboxusercontent.com/u/1702...lorfix.zip

The TEXTOUT_P's responsible for text within the tiles didn't have a color specified, so they defaulted to system default.
Which changes with the theme, resulting in white text on light background when using the Dark color theme.

I've hardcoded #000000 in those places.
Find all posts by this user
Quote this message in a reply
04-10-2014, 03:44 PM
Post: #18
RE: Periodic Table program
(04-10-2014 03:06 PM)orcinus Wrote:  Tiny tweak to Miguel's fork:
https://dl.dropboxusercontent.com/u/1702...lorfix.zip

The TEXTOUT_P's responsible for text within the tiles didn't have a color specified, so they defaulted to system default.
Which changes with the theme, resulting in white text on light background when using the Dark color theme.

I've hardcoded #000000 in those places.

Thank you so much, I will also update the zip file in my post with this one.

Regards,

Miguel
Find all posts by this user
Quote this message in a reply
04-10-2014, 07:53 PM (This post was last modified: 04-10-2014 09:12 PM by Han.)
Post: #19
RE: Periodic Table program
(04-10-2014 03:06 PM)orcinus Wrote:  Tiny tweak to Miguel's fork:
https://dl.dropboxusercontent.com/u/1702...lorfix.zip

The TEXTOUT_P's responsible for text within the tiles didn't have a color specified, so they defaulted to system default.
Which changes with the theme, resulting in white text on light background when using the Dark color theme.

I've hardcoded #000000 in those places.

Some suggestions for this version:

1. Make the element selection a local variable but declared outside of any function so that when a user re-runs the program, the previously selected element is the default selection. Or, have the default selection already be set to 1 (Hydrogen).
2. The selected element should be more visible. The 2-pixel wide line used to draw the box is very hard to read. Instead, use FILLPOLY with an alpha blending that darkens the background color and changes the font to white. It makes the selection stand out and much easier to see.
3. The keyboard handler is very inefficient and makes it so that the user must have a key held down at exactly the moment the program executes the ISKEYDOWN() command. Since you are using WAIT without any arguments, it will wait a set amount of time (1 minute ?) before checking the status of the key. So a user could press something and nothing will happen if the code is still inside the internal WAIT loop. Instead, use WAIT(-1) and parse the output there. Here's a skeleton on how to create a keyboard and mouse handler with WAIT():

Code:

EXPORT KMINPUT()
BEGIN
  LOCAL run:=1, key;

  // change run to 0 to exit the while loop
  key:=WAIT(-1);
  CASE
    IF TYPE(key)==6 THEN
      // we have touchscreen events
      CASE
        IF key(1)==0 THEN kmMouseDown(); END;
        IF key(1)==1 THEN kmMouseUp(); END;
        // ... more mouse events
        IF key(1)==7 THEN kmMouseLongClick(); END;

        kmMouseEvent(); // default handler
      END;
    END; // end of touch events

    // at this point, all touch events were handled due to the
    // TYPE(key)==6 check; so only key-presses are left
    // and if a touch event occurred, these tests below are
    // never reached

    IF key==0 THEN kmDoAppsKey(); END;
    // ... more key definitions here
    IF key==50 THEN kmDoPlusKey(); END;

    kmOtherEvents(); // handle all remaining undefined keys
  END;

END;

Encase the code above inside a loop environment and you will always trap a user's keypress. This is only good for when you expect users to not press any keys during the execution of subroutines, of course, although it should still work since there is (should be?) a key buffer. You can additionally add in an ISKEYDOWN() check in addition to a WAIT(-1). I do this in my COLUMNS program so that the game detects both a single keypress as well as keys that are held down.

Edit:

Possible bugs?
1) Select an element, press ENTER. Then press HOME. Now, scroll the screen and press ENTER (don't choose a new element). --> nothing happens
2) Select an element, press ENTER. Then press HOME. Now, choose to menu option. Press OK when given the prompt and return to the table. Now press ENTER. --> nothing happens

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-10-2014, 11:11 PM
Post: #20
RE: Periodic Table program
Thank you Han,

I will have some quality time, debugging and implementing your suggestions during the week-end.

Regards,

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




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