Post Reply 
Automatically generating program from a template.
01-17-2015, 04:18 AM
Post: #1
Automatically generating program from a template.
Hello,

Automatically generating program from a template.
Is it at all possible to automatically generate program from a template. Lets say, I want to make some kind of library for functions or for doing something on sets of equations. For the template it would require to do some "staff" and this would be the same repetitious task for all entries in the library.
I do not now if it is at all possible to write a program on HP Prime using some input parameters and the given template already present on HP Prime. The program written on HP Prime would have to do some "staff" on a copy of the template and then rename the copy of the template and store it as a user program to show it in the "User Catalog" under some library name. Thank you.

Cheers
Find all posts by this user
Quote this message in a reply
01-17-2015, 04:20 AM
Post: #2
RE: Automatically generating program from a template.
You can using the Programs() command. You can use it to create a new program from a string.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
01-17-2015, 06:44 AM (This post was last modified: 01-17-2015 06:47 AM by John P.)
Post: #3
RE: Automatically generating program from a template.
Hello Han,

Yes, it works. Exactly what I needed. Thanks.

Cheers
Find all posts by this user
Quote this message in a reply
01-18-2015, 03:34 AM
Post: #4
RE: Automatically generating program from a template.
Where is that documented?
I saw something on the Forum about Programs() but thought it just made a List of Program Names.
Don't see it in the User Guide.
Find all posts by this user
Quote this message in a reply
01-18-2015, 04:43 AM (This post was last modified: 01-18-2015 04:44 AM by Didier Lachieze.)
Post: #5
RE: Automatically generating program from a template.
It is documented in the HP Prime Help: type "Programs" and press Help.

[Image: 1d0in.png]
Find all posts by this user
Quote this message in a reply
01-18-2015, 05:45 AM
Post: #6
RE: Automatically generating program from a template.
A little off topic, but how Programs and Notes aren't harmful functions like the "Flags" in the older hps? I mean I like having these functions but aren't they destroying the isolated-"App" concept?

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
01-18-2015, 07:04 AM
Post: #7
RE: Automatically generating program from a template.
Hello,

I have problem with generating program to work the way I want.
To make things clear I want to make the distinction between generating an generated programs.
The generated program is the output from "Programs()" that I want in my "User Catalog". Everything is fine and the candidate for generated prgm. is a string that I can manipulate using "REPLACE" to do some changes to dummy placeholder substrings depending on what I want. The "REPLACE" replaces substring with another substring and that is OK too. The "Programs("name"):="string" spits out the program but then there is a problem because sometimes in the generated program I need to have string(s) preserved, when the generated prgm. is not a string anymore. What I do not know how to do is: how do I replace inside a string (future generated prgm.) something with another substring that will remain string after passing through "Programs()" or to put it differently: how to stick a substring inside a string that will stay string (when the generated prgm. is not a string anymore). I need that because inside the generated program, when it is in "User Catalog" ready to be used I need to do some processing that can only be done with strings because that is how CAS programs work in HP Prime, I think.

Cheers
Find all posts by this user
Quote this message in a reply
01-18-2015, 09:53 AM
Post: #8
RE: Automatically generating program from a template.
(01-18-2015 07:04 AM)John P Wrote:  how to stick a substring inside a string that will stay string (when the generated prgm. is not a string anymore).

You can use "" inside double quotes to represent a single ".

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
01-18-2015, 02:17 PM
Post: #9
RE: Automatically generating program from a template.
Or use the string command. STRING("abc") -- this saves you from having to keep track of the double quotes.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
01-18-2015, 02:48 PM
Post: #10
RE: Automatically generating program from a template.
Hello,

I will try "STRING(abc)" or "STRING("abc")" later on. I can do what I want with the prgm. but I have to edit it manually when changing something inside. I wanted to do it automatically passing some parameters to generating prgm. to stick in the generated prgm. but as of today I do not know how.

Doing """ quote inside double quot or double quot inside double quot """" does nor work. Thanks.

Cheers
Find all posts by this user
Quote this message in a reply
01-19-2015, 12:28 AM
Post: #11
RE: Automatically generating program from a template.
(01-18-2015 02:17 PM)Han Wrote:  Or use the string command. STRING("abc") -- this saves you from having to keep track of the double quotes.

Hello,

Yes, it works like a charm with STRING(some_name). When the string for the generated prgm. passes through "Programs("name_for_the_prgm"):=string;" whatever is inside STRING(some_name) stays as a string so the generated program has no problems.

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




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