HP Forums
HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - 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: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program (/thread-5284.html)



HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-07-2015 12:27 AM

I'm creating a simple spreadsheet application for the HP Prime. I need to be able to change the headers of the columns from within the program, but can't find how to accomplish that. Is it even possible? Any help would be appreciated.
Thanks


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - Tyann - 12-07-2015 06:04 AM

Bonjour
Hello
Code:
Cell(0,n,2):="name"
n=n°de colonne avec A=1,B=2 etc...
n = No. of column A = 1, B = 2 etc ...
Pour nommer une ligne:
To name a line :
Code:
Cell(n,0,2):="name"



RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-07-2015 06:34 AM

Thanks a lot Tyann. It worked like a charm! Quick question, if you don't mind. Is that information in the user's guide or did you get if from another place? I'm asking because I've being trying to learn the programming language of the calculator but I'm having a hard time learning from the user's guide. I found some quick tutorials from Han Duong and Edward Shore, which were great to grasp the basics; but I question myself if there exist another source of information that I'm not aware of, because sometimes their tutorials include details which I'm sure are not in the user's guide. For example, this information you gave me I couldn't find it in the guide, but now that I now that command exists I found more detailed information in the help of the calculator. I was under the impression that user's guide was the most complete reference and it doesn't seem to be so. Any information will be appreciated.

Thanks


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - Tyann - 12-07-2015 11:56 AM

Bonjour
Peut-être n'avez vous pas la dernière version, ou avez vous le guide
rapide.
Regardez ici:

Hello
Maybe you do not have the latest version , or you have the guide
Quick .
Look here:

ftp://ftp.hp.com/pub/calculators/Prime/Documentation/Calculator/


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - Didier Lachieze - 12-07-2015 01:26 PM

From the built-in help about "Cell":

Quote:Syntax: Cell(RowNumber, ColNumber, [n])
[..]
For the Cell access method, note that Cell(0, Col) gives access to the specified column, Cell(Row,0) gives access to the specified row and Cell(0,0) gives access to the sheet definition itself.
[...]
CELL ATTRIBUTES (n)
[...]
2: name



RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-07-2015 07:48 PM

(12-07-2015 01:26 PM)Didier Lachieze Wrote:  From the built-in help about "Cell":

Quote:Syntax: Cell(RowNumber, ColNumber, [n])
[..]
For the Cell access method, note that Cell(0, Col) gives access to the specified column, Cell(Row,0) gives access to the specified row and Cell(0,0) gives access to the sheet definition itself.
[...]
CELL ATTRIBUTES (n)
[...]
2: name

Hi, Didier, Tyann!
Thanks! Lets suppose I want to select a range of column headers (A to C). I put custom labels there and desire to change the Horizontal Aligning. I tried the following: Cell(0,1):Cell(0,3)(8):=1; but get a syntax error. Tried different things but none worked so far. Any ideas?
Thanks


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - Tyann - 12-07-2015 08:12 PM

Bonjour
Je ne sais pas si l'on peut spécifier un bloc de cellules avec Cell(.
Pour vôtre cas le plus simple me semble:

Hello
I do not know if we can specify a block of cells with Cell ( .
In the simplest case yours seems to me :

Code:
FOR I FROM 1 TO 3 DO
Cell(0,I,8):=1;
END;



RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-07-2015 08:23 PM

Hi,
Yes, you're right, that should work. I considered doing some kind of loop like that but thought there was something more compact to accomplish it. Do you know if I can clear a Spreadsheet from a program? I mean, similar to the functionality of SHIFT+ESC. I tried RECT(); but it didn't work.
Thanks


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - Tyann - 12-07-2015 09:23 PM

Il n'existe pas à ma connaissance de moyen satisfaisant pour faire cela.
Vous pouvez faire un truc du genre :

It does not exist to my knowledge satisfactory way to do that.
You can do something like :

Code:
A1:z999:=0 or A1:z999:=""

par exemple.
for example.


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-08-2015 02:03 AM

(12-07-2015 09:23 PM)Tyann Wrote:  Il n'existe pas à ma connaissance de moyen satisfaisant pour faire cela.
Vous pouvez faire un truc du genre :

It does not exist to my knowledge satisfactory way to do that.
You can do something like :

Code:
A1:z999:=0 or A1:z999:=""

par exemple.
for example.

Yeah, it could be a quick fix in some situations, but that method won't clear any attributes set in the cells, like bgcolor, aligning, etc. I'm getting frustrated because there are a lot of basic questions on the programming side that just doesn't seen to be covered in the user's guide. I really appreciate your help. I think this calculator has a lot of potential but the documentation needs to be improved a lot in certain areas. Most students would give up before bothering that much to get something done. :0(


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - Tyann - 12-08-2015 06:14 AM

Bonjour
Pour effacer les attributs il faut mettre -1.
Par exemple, pour remettre le nom d'origne A d'une colonne:

Hello
To clear the attributes must be put -1 .
For example, to replace the name of a column origne A :

Code:
Cell(0,1,2):=-1



RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - cyrille de brébisson - 12-08-2015 06:21 AM

Hello,

Cell(0,1):Cell(0,3)(8):=1

will not work for 2 reasons:
Cell(0,1):Cell(0,3)
is not recognized by the Spreadsheet app as a cell/range reference.
only name:name is (with name either a named cell name or a traditional cell reference).

Cell(0,3)(8) is also not recognized. the (8) only works when the stuff on the left is a variable that contains a list or matrix object.
In this care, the stuff on the left is Cell(0,3) which is NOT a variable but a function call that returns a list and {data}(n) is not a recognized syntax/operator in PPL.

In this case, you will indeed have to use a loop, sorry about that.

Cyrille


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jrozsas - 12-08-2015 10:56 AM

Thanks!
I liked that explanation because the HP updated Manual (latest version- portuguese) does not appear so. This information exists only in the HELP Calculator.


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-08-2015 01:45 PM

That's great. I think now I have enough information to complete the task. Thanks a lot for your help!


RE: HP PRIME: Can the Columns headers of a spreadsheet be changed from a program - jasonX - 12-08-2015 02:13 PM

(12-08-2015 06:21 AM)cyrille de brébisson Wrote:  Hello,

Cell(0,1):Cell(0,3)(8):=1

will not work for 2 reasons:
Cell(0,1):Cell(0,3)
is not recognized by the Spreadsheet app as a cell/range reference.
only name:name is (with name either a named cell name or a traditional cell reference).

Hi, Cyrille!
Thanks for a very valuable insight on the fundamentals. Question...is it reasonable to assume that a command mimicking the functionality of "SHIFT +ESC (clear)" could be made available to the programming language, to be able to reset the spreadsheet app, since the functionality already exist? I mean, I can do it manually, but it seems not such command exist to do it in a program.