HP Forums
Prime newbie questions - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Prime newbie questions (/thread-19490.html)



Prime newbie questions - x34 - 01-31-2023 11:57 AM

Hi! Just started to use me new Prime G2. I am very depressed by the built-in program editor, which very bad. Several questions:

1. Why there is no dedicated assignment operator ":=" key? ALPHA+Enter looks like very good candidate.

2. Is it possible to get rid of the line numbers? It is not BASIC, why do we need them?

3. Are there any loadable editors with search/replace and syntax highlight?

4. Where can I find information on USB commands?

5. Also, I am unable to find information about variable types (real/integer/string/char/list,etc) and conversion/cast.

tia, Paul


RE: Prime newbie questions - Guenter Schink - 01-31-2023 08:58 PM

(01-31-2023 11:57 AM)x34 Wrote:  Hi! Just started to use me new Prime G2. I am very depressed by the built-in program editor, which very bad. Several questions:

1. Why there is no dedicated assignment operator ":=" key? ALPHA+Enter looks like very good candidate.

2. Is it possible to get rid of the line numbers? It is not BASIC, why do we need them?

3. Are there any loadable editors with search/replace and syntax highlight?

4. Where can I find information on USB commands?

5. Also, I am unable to find information about variable types (real/integer/string/char/list,etc) and conversion/cast.

tia, Paul

1. Seems to be a good Idea. Side effects?
2. Once you develop longer programs, line numbers are very helpful. Look at <More> while in the editor. Easy to jump to a specific line. BTW: Line numbers are not part of the code, they are part of the editor.
3. Notepad++ comes in very handy(if you have Windows), even with an HP Prime extension available. Here you'll see line numbers again, very helpful for navigation in longer files.
4. don't know
5. Use pre-defined A..Z, L0..L9, M0..M9 for numeric, List and Matrix variables respectively. If you need more descriptive variable names or something for strings etc., create them by typing in anything, touch the Sto> soft button and give it an arbitrary name, confirm that you want to create it - et voilà this variable is now available to your convenience.

Except for the pre-assigned names mentioned above, the name doesn't say anything about the content. E.g. an intentionally name created as shown above e.g "name" may now contain a number but next time a matrix or string. It's under your control. You mentioned "it's not Basic", you're right it isn't.

WRT to conversion, the fine manual is where to go.

HTH Günter


RE: Prime newbie questions - x34 - 01-31-2023 10:41 PM

(01-31-2023 08:58 PM)Guenter Schink Wrote:  1. Seems to be a good Idea. Side effects?
2. Once you develop longer programs, line numbers are very helpful. Look at <More> while in the editor. Easy to jump to a specific line. BTW: Line numbers are not part of the code, they are part of the editor.
3. Notepad++ comes in very handy(if you have Windows), even with an HP Prime extension available. Here you'll see line numbers again, very helpful for navigation in longer files.
4. don't know
5. Use pre-defined A..Z, L0..L9, M0..M9 for numeric, List and Matrix variables respectively. If you need more descriptive variable names or something for strings etc., create them by typing in anything, touch the Sto> soft button and give it an arbitrary name, confirm that you want to create it - et voilà this variable is now available to your convenience.

Except for the pre-assigned names mentioned above, the name doesn't say anything about the content. E.g. an intentionally name created as shown above e.g "name" may now contain a number but next time a matrix or string. It's under your control. You mentioned "it's not Basic", you're right it isn't.

WRT to conversion, the fine manual is where to go.

HTH Günter
Thanks Günter!

1. Dunno, I am Prime newbie, but apparently ALPHA+Enter is just plain Enter now, not mapped.
2.I've developed hundreds of programs with thousands of lines without numbers, never seen any problem. It is more comfortable just to see current line number somewhere at the top or bottom of the screen, not consuming valuable space of the already small screen.
3.No, I need editor running on the Prime itself. vi is good enough for cross-development, but often you need to write code on the fly in situ.
5. Pity. No static typing, records and pointers. Eagerly waiting for working Python or Lua implementation, or, better extending HP PPL to the level of Modula/Pascal.


RE: Prime newbie questions - JimP - 01-31-2023 11:40 PM

One place you might want to look is under Eddie Shore's Math and Calculator blog, he has a whole section on Prime programming. Eddie's splendid contributions to this whole field cross everywhere from old calculators to the newest, with regular retro reviews. https://edspi31415.blogspot.com/ -- on the right hand side of the web page you'll see a link to a tutorial. Might find some good information there!


RE: Prime newbie questions - x34 - 02-01-2023 05:56 AM

(01-31-2023 11:40 PM)JimP Wrote:  One place you might want to look is under Eddie Shore's Math and Calculator blog, he has a whole section on Prime programming. Eddie's splendid contributions to this whole field cross everywhere from old calculators to the newest, with regular retro reviews. https://edspi31415.blogspot.com/ -- on the right hand side of the web page you'll see a link to a tutorial. Might find some good information there!

Thanks. Very good tutorial.


RE: Prime newbie questions - Tyann - 02-01-2023 11:34 AM

(01-31-2023 11:57 AM)x34 Wrote:  Hi! Just started to use me new Prime G2. I am very depressed by the built-in program editor, which very bad. Several questions:

1. Why there is no dedicated assignment operator ":=" key? ALPHA+Enter looks like very good candidate.
, Paul

Bonjour
Vous pouvez assigner ":=" à une touche grâce au mode USER.
Normalement selon la documentation 'ALPHA' + 'ENTER' est une combinaison possible,
malheureusement sur ma prime G2 version 14588 ça ne fonctionne pas tout comme
'ALPHA' + 'APPS'
Sinon pour assigner des fonctions à une touche, vous devez créer un programme puis appuyer
sur la touche 'Menu' et choisir l'option 'Créer une touche utilistateur' puis appuyer sur la touche
que vous avez choisi.
Vous obtiendrez alors :
Code:

KEY K_Apps()
BEGIN

END;
par exemple si vous choisissez la touche 'Apps'
puis compléter comme ceci :
Code:

KEY K_Apps()
BEGIN
 RETURN ":=";
END;
Voilà.
Vous pouvez programmer plusieurs touches dans le même programme.


Hello
You can assign ":=" to a key through the USER mode.
Normally according to the documentation 'ALPHA' + 'ENTER' is a possible combination,
unfortunately on my G2 version 14588 it doesn't work just like
ALPHA' + 'APPS
Otherwise, to assign functions to a key, you have to create a program then press the 'Menu' key and choose the option 'Create a user key' then press the key you have chosen.
You will then get :
Code:

KEY K_Apps()
BEGIN

END;
for example if you choose the 'Apps' key
then complete it like this:
Code:

KEY K_Apps()
BEGIN
 RETURN ":=";
END;
That's it.
You can program several keys in the same program.

Translated with http://www.DeepL.com/Translator (free version)