Post Reply 
PrimeComm uncovers something weird in a Program file
03-18-2015, 01:35 AM (This post was last modified: 03-18-2015 01:36 AM by bobkrohn.)
Post: #1
PrimeComm uncovers something weird in a Program file
I opened my large program in PrimeComm Editor.
I noticed some odd characters at the very first part of the file.
There is a Chinese character then what looks like an ASCII representation of an ASCII Control code.
In this case "EOT" or ASCII code 04

I have attached a screen capture of the PrimeComm Editor.

Looked at some past Backups (of same .hpprgm) and I'm seeing different but similar stuff.

These characters do NOT show up in other of my .hpprgm files.

These characters do NOT show up in the Connectivity Kit Program Editor.

I have not yet tried deleting them and saving the file from PrimeComm.

Another question:
Is everybody comfortable with doing all editing from within PrimeComm?
Then saving the file to the calculator?
Are you ACTUALLY doing this?

Thank You

I will send a PM to the author of PrimeComm


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
03-18-2015, 02:36 AM (This post was last modified: 03-18-2015 02:43 AM by Han.)
Post: #2
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 01:35 AM)bobkrohn Wrote:  I opened my large program in PrimeComm Editor.
I noticed some odd characters at the very first part of the file.
There is a Chinese character then what looks like an ASCII representation of an ASCII Control code.
In this case "EOT" or ASCII code 04

I have attached a screen capture of the PrimeComm Editor.

Looked at some past Backups (of same .hpprgm) and I'm seeing different but similar stuff.

These characters do NOT show up in other of my .hpprgm files.

These characters do NOT show up in the Connectivity Kit Program Editor.

I have not yet tried deleting them and saving the file from PrimeComm.

Another question:
Is everybody comfortable with doing all editing from within PrimeComm?
Then saving the file to the calculator?
Are you ACTUALLY doing this?

Thank You

I will send a PM to the author of PrimeComm

In general, I use a plain text editor, nothing fancy. Then I simply copy/paste into the virtual calc. And if I want to send it to my calculator, I send it from virtual calc to actual calculator.

I am surprised that you continue to use backups if you have no way to verify that the backups themselves are bug free. The post above seems to suggest that your backups themselves may be the source of your issues. I recommend cleaning out your state files for the virtual calc and only copying the text-only source code into the virtual calc. Only then will you know that you have an absolutely pristine state. If it works there, then it should work similarly on the actual hardware (knock on wood). And before sending it to the hardware, I also recommend doing a factory reset there, too (formatting). If you've done all that and both virtual calc and hardware are misbehaving, then it's pretty clear that you have run into a bug. Otherwise, you may as well ask whether the chicken or the egg came first.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
03-18-2015, 03:32 AM
Post: #3
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 02:36 AM)Han Wrote:  In general, I use a plain text editor, nothing fancy. Then I simply copy/paste into the virtual calc. And if I want to send it to my calculator, I send it from virtual calc to actual calculator.

How do you "send" from virtual calc to actual calculator, without the CK? The UG seems to imply it can be done, but the SEND button doesn't seem to know where my actual USB2 connected calculator is. It's a simple thing with the CK, via drag/drop.
Find all posts by this user
Quote this message in a reply
03-18-2015, 04:01 AM (This post was last modified: 03-18-2015 04:42 AM by bobkrohn.)
Post: #4
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 02:36 AM)Han Wrote:  In general, I use a plain text editor, nothing fancy. Then I simply copy/paste into the virtual calc. And if I want to send it to my calculator, I send it from virtual calc to actual calculator.

I am surprised that you continue to use backups if you have no way to verify that the backups themselves are bug free. The post above seems to suggest that your backups themselves may be the source of your issues. I recommend cleaning out your state files for the virtual calc and only copying the text-only source code into the virtual calc. Only then will you know that you have an absolutely pristine state. If it works there, then it should work similarly on the actual hardware (knock on wood). And before sending it to the hardware, I also recommend doing a factory reset there, too (formatting). If you've done all that and both virtual calc and hardware are misbehaving, then it's pretty clear that you have run into a bug. Otherwise, you may as well ask whether the chicken or the egg came first.


Text Editors-
I tried at first to use UltaEdit. By that time I had made extensive use (right or wrong) of the A-> B style of storing a variable rather than the B:=A style.
UltraEdit can't understand the -> (unicode) and replaces it with a "?".
I had hundreds of them by then.
No Good.


I got some advice on this Forum on some other programmer focused editors.
I have started to play with those. The nice thing about the PrimeComm Editor is that it is specifically for the Prime.
I just started to try editing files in PrimeComm and then Copy-n-Paste into the open file in Connectivity Kit (CK)

Backups-
I backup constantly. Right now, from about 3 months with the Prime, I have about 110 backup zips. (of course I'm not really looking at 3 week old zips but I have the space so what the heck)
"Usually" I only backup when it APPEARS that the Prime is behaving correctly.
My clue when things have gone bad is EXCESSIVE compile time and/or FALSE Syntax Error messages.
I am now also saving the hpprgm files directly to one folder via drag-n-drop from CK to PC. On occasion I drag-n-drop a file from PC to CK.
After deleting the file from the CK first. (won't overwrite like the other direction will)

Are you saying that
loading hpprgm files from PC to Emulator via the CK and then Drag-N-Drop
to the Physical Prime via CK
provides some sort of extra "filtering" of corrupt files?
Find all posts by this user
Quote this message in a reply
03-18-2015, 04:08 AM
Post: #5
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 03:32 AM)DrD Wrote:  How do you "send" from virtual calc to actual calculator, without the CK? The UG seems to imply it can be done, but the SEND button doesn't seem to know where my actual USB2 connected calculator is. It's a simple thing with the CK, via drag/drop.

On the main menu, Calculator -> Connect To -> pick which calculator

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
03-18-2015, 08:42 AM
Post: #6
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 01:35 AM)bobkrohn Wrote:  I opened my large program in PrimeComm Editor.
I noticed some odd characters at the very first part of the file.
...

Please check and repair your file(s) with an hex editor, e.g. HxD (http://mh-nexus.de/en/). Delete the weird characters.
There should be no extra characters in your file(s).

PS: the editor in PrimeComm is based on scintilla (http://www.scintilla.org/), (eried: please correct me, if I'm wrong!)
SciTE is a 'Scintilla' based Text Editor. http://www.scintilla.org/SciTE.html
All sources from Primecomm are free available, see http://ried.cl/en/franqueando-los-secret...a-inversa/ and https://github.com/eried/PrimeComm,
feel free to develop your own fork.
Find all posts by this user
Quote this message in a reply
03-18-2015, 09:45 AM
Post: #7
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 08:42 AM)Thomas_Sch Wrote:  PS: the editor in PrimeComm is based on scintilla (http://www.scintilla.org/)

I noticed it says there
" ...permits use in any free project or commercial product."

Maybe HP should have used it for Connectivity Kit Program Editor.
Maybe it's not too late provide customers with a functional product?
Not my job. (I'm the paying customer)
Find all posts by this user
Quote this message in a reply
03-18-2015, 10:01 AM
Post: #8
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 09:45 AM)bobkrohn Wrote:  ...
Not my job. (I'm the paying customer) ...
But it's your job to repair your files. Just to ensure, that the weird characters are not the source of some of your problems.

As far as i could check, Primecomm does not support UTF-8 encoding, so the special characters available in Prime are not supported correctly.
Since "temporary end of development" of PrimeComm maybe it's not a good option for editing programs. I would use one of the many free programmers editors.
Find all posts by this user
Quote this message in a reply
03-18-2015, 11:43 AM
Post: #9
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 04:08 AM)Tim Wessman Wrote:  On the main menu, Calculator -> Connect To -> pick which calculator

Well ... that's cool. (Old doggie got a new trick!)

-Dale-
Find all posts by this user
Quote this message in a reply
03-18-2015, 01:37 PM
Post: #10
RE: PrimeComm uncovers something weird in a Program file
I don't know if the hpprgm structure changed, but for the moment isn't recommended to use Primecomm. It was all made from reverse engineering from early versions of the firmware/connkit.

I have updated the warning in the primecomm download page.

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
03-18-2015, 02:44 PM
Post: #11
RE: PrimeComm uncovers something weird in a Program file
Yuck, that's not something I want to hear.
I thought the issue with PrimeComm was just to do with the communications part.
Thanks Erwin. I hope there will be some fix for PrimeComm eventually.

I did erase the odd characters and reload the hpprgm.
No smoke or flames came out of the Prime yet.
So maybe the corruption (if it was) is not critical.

I'm going to go drown my sorrow with a McDonald's Egg McMuffin and an apple pie.
Find all posts by this user
Quote this message in a reply
03-18-2015, 04:34 PM
Post: #12
RE: PrimeComm uncovers something weird in a Program file
Being able to "SEND" directly from the VC to the HC makes using Notepad ++ very practical. Line numbers, tab stops, LARGE readable text are but a few of it's neat features.

I was aware of the calculator menu item "Connect To," before, but I must not have had the HC on at the time, because it always showed "None" with a checked box. I was thinking all along that had to do with the data streamer. Yet another inspiration from Han, and Tim. Thanks!

It would be terrific to have a full featured editor to replace the CK. Of the many requests for new features and bug fixes, embellishing the CK would be near the top of any list I might submit.

-Dale-
Find all posts by this user
Quote this message in a reply
03-19-2015, 12:50 AM
Post: #13
RE: PrimeComm uncovers something weird in a Program file
(03-18-2015 04:34 PM)DrD Wrote:  ... using Notepad ++ very practical. Line numbers, tab stops, LARGE readable text are but a few of it's neat features.

-Dale-

I hate to be the one to always finding problems.
I have attached a screen clip from NotePad++.
I loaded one of my .hpprgm files into it.
While perusing through I noticed something weird.

I was using the A->B rather than B:=A form of variable storage. (right or wrong that's what I did)
I noticed that some of the "->" symbols were displayed as an empty box thing.
No sense to it.

What's that all about????
Another hidden corruption??
I'm losing my mind trying to find some way to easily and reliably edit code.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
03-19-2015, 01:43 AM
Post: #14
RE: PrimeComm uncovers something weird in a Program file
(03-19-2015 12:50 AM)bobkrohn Wrote:  
(03-18-2015 04:34 PM)DrD Wrote:  ... using Notepad ++ very practical. Line numbers, tab stops, LARGE readable text are but a few of it's neat features.

-Dale-

I hate to be the one to always finding problems.
I have attached a screen clip from NotePad++.
I loaded one of my .hpprgm files into it.
While perusing through I noticed something weird.

I was using the A->B rather than B:=A form of variable storage. (right or wrong that's what I did)
I noticed that some of the "->" symbols were displayed as an empty box thing.
No sense to it.

What's that all about????
Another hidden corruption??
I'm losing my mind trying to find some way to easily and reliably edit code.

Bob - Maybe it would be smoother and save time to simply use the B:=A syntax rather than using the -> symbols? I get that you started that way and prefer it for whatever reasons, but since you don't care for the CK editor (me neither) and probably should be using a programming editor (I prefer TextPad) it's best IMHO to stick with simple ASCII characters in your source files. Fewer bumps in the road.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
03-19-2015, 02:23 AM (This post was last modified: 03-19-2015 02:27 AM by bobkrohn.)
Post: #15
RE: PrimeComm uncovers something weird in a Program file
I am using the A:=B form now in all new stuff.
Maybe I did it because less keystrokes?
I haven't checked any other non-ASCII type stuff like square root.

BTW, PrimeComm displays the same code PROPERLY.
i.e. with the little right arrow.

It's a case of "If I only knew then what I know now".
Why can't things just...work?
I'm so tired of this.
Find all posts by this user
Quote this message in a reply
03-19-2015, 08:23 AM
Post: #16
RE: PrimeComm uncovers something weird in a Program file
(03-19-2015 02:23 AM)bobkrohn Wrote:  I am using the A:=B form now in all new stuff.
Maybe I did it because less keystrokes?
I haven't checked any other non-ASCII type stuff like square root.

BTW, PrimeComm displays the same code PROPERLY.
i.e. with the little right arrow.

It's a case of "If I only knew then what I know now".
Why can't things just...work?
I'm so tired of this.
It's a matter of font settings.
Hints for Notepad++ font settings:
Go to: Menu, Settings, 'Style configurator'
Change the settings for
'Style' = Global override, Default Style,
Font Style:
from "Courier New" (or whatever is set)
to "DejaVu Sans Mono"
and you get your arrows back.

It is also a good practice to set 'Encoding' to UTF-8 (per file).

Plain text files should be named .txt. .hpprgm files are not plain text files!
(try to open .hpprgm-files from backup, and you will see additional non-printing characters).
Find all posts by this user
Quote this message in a reply
03-19-2015, 10:48 AM
Post: #17
RE: PrimeComm uncovers something weird in a Program file
(03-19-2015 02:23 AM)bobkrohn Wrote:  It's a case of "If I only knew then what I know now".
Why can't things just...work?
I'm so tired of this.

Welcome to the learning curve.

"Patience is a virtue," and a corollary might be, "forums are a virtue, patience!" Needless to say, imagine how much more frustrating it would be if we were left to navigate the complex, without the rich resources of the participants in these forums! Some say we don't live in a perfect world, (at times like these); but there is a broader point that probably should be the real focus ... it is up to the world to make it a more perfect place.

Compared to the rest of the world, this place ain't bad...

-Dale-
Find all posts by this user
Quote this message in a reply
03-19-2015, 06:19 PM
Post: #18
RE: PrimeComm uncovers something weird in a Program file
OK! that was it. Wrong Font.
Still, it's odd that some displayed correctly and some didn't.
Thank You Very Much.

So, is the following a proper procedure?

Open Connectivity Kit Editor with your file of choice.
Copy all the code in Connectivity Kit Editor
Open Note++
Paste all the code into NotePad++
Do your thing
Copy all the code in NotePad++
Paste all the code back to Connectivity Kit Editor
(after deleting all old code)

As an experiment, I opened the same .hpprgm in NotePad++
It appears to now display everything correctly.
Am I right to assume that saving the modified code as .hpprgm would not be good?
Find all posts by this user
Quote this message in a reply
03-19-2015, 07:08 PM
Post: #19
RE: PrimeComm uncovers something weird in a Program file
(03-19-2015 06:19 PM)bobkrohn Wrote:  So, is the following a proper procedure?

Open Connectivity Kit Editor with your file of choice.
Copy all the code in Connectivity Kit Editor
Open Note++
Paste all the code into NotePad++
Do your thing
Copy all the code in NotePad++
Paste all the code back to Connectivity Kit Editor
(after deleting all old code)

As an experiment, I opened the same .hpprgm in NotePad++
It appears to now display everything correctly.
Am I right to assume that saving the modified code as .hpprgm would not be good?


This is also my approach.
Code:
C.K.: Programs: <my program> Strg+A, Strg+C   --->  Notepad++: Strg+V  
Notepad++: (Encoding, encode as UTF-8),  edit program,  save as .txt-file
Notepad++: Strg+A, Strg+C   --->  C.K.,  Strg+A, Strg+X, ; Insert: Strg+V, Save
But I guess there is not only one way to Rome ;-)

And yes, save as text file causes fewer misunderstandings.
Find all posts by this user
Quote this message in a reply
Post Reply 




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