Post Reply 
HPP-CK Improvement: Overwrite confirmation
03-27-2017, 05:42 PM (This post was last modified: 03-27-2017 05:48 PM by Han.)
Post: #4
RE: HPP-CK Improvement: Overwrite confirmation
(03-27-2017 04:59 PM)compsystems Wrote:  Resolves at least one problem, that if the file is renamed this remains functional.

Does it? If I wrote my own program and used the same internal name as you did, and also used the same function names like main()... there is no way to distinguish my program from yours since (in this example) we have two instances of internalname.main(). The filename.programname() scheme eliminates this issue since 1) you cannot use duplicate file names and 2) any exported programs/variables that share the same name can be distinguished using the fully qualified name: filename.variable or filename.programname(). I do not see how it would be possible to enforce unique internal names except for programs created on the calculator. But if a user downloads a program that uses the same internal name as an existing program, what do you propose the calculator do in this case?

Quote:Currently if you rename a file that is used by another program, this is unusable.

As for renaming files causing programs to break, this should be expected. It would be no different from HP renaming the SOLVE command to HPSOLVE and causing compatibility issues with existing programs that use the SOLVE command. Those programs would have to be manually updated. Similarly, on the HP48, if you write a program that calls another program named MYPROG that was stored in another directory, you would have to use the full path to MYPROG. Renaming the directory would cause your program (that needed MYPROG) to break.

EDIT: I recommend using a naming scheme that makes your program(s) more likely to be unique. Avoid using generic names like main(), for example. Instead, if your file is called LinearAlgebra, then consider using laMain() for the main function (note the 'la' -- short for linear algebra). Or perhaps linalgMain(). Other related programs could be called linalgProg1(), etc. This way, you may not even need to use the fully qualified names and the naming scheme is even quite similar to the one currently being used by the firmware.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HPP-CK Improvement: Overwrite confirmation - Han - 03-27-2017 05:42 PM



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