12-08-2015, 10:54 AM (This post was last modified: 09-06-2016 11:39 AM by jrozsas.)
Post: #1
 jrozsas Member Posts: 158 Joined: Nov 2014
Hi,
In APP spreadsheet, it is possible to make a program to create a spreadsheet and enter a value in cells? Is there any example?
I want to create a program that creates a spreadsheet and enter values in the cells.

Leo

12-09-2015, 05:51 AM
Post: #2
 cyrille de brébisson Senior Member Posts: 1,047 Joined: Dec 2013
Hello,

Yes, it is.

Make a copy of the spreadsheet app (move cursor on spreadsheet and click on save) (let us call is sscpy)

start the app.
go in the program catalog, click on sscpy program and enter:
START()
BEGIN
local a;
for a:= 1 to 10 do
Cell(a,1):= a^2;
end;
END;

exit the program catalog, back in app view. Now, when you START the app (clicking on the app icon when in the APP catalog only starts the app if it was NOT the current app, so you need first to exit to another app and then return to sscpy), so, when you start the app, it will execute the START function and populate your spreadsheet.

cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
12-09-2015, 11:11 AM (This post was last modified: 12-09-2015 11:16 AM by jrozsas.)
Post: #3
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-09-2015 05:51 AM)cyrille de brébisson Wrote:  START()
BEGIN
local a;
for a:= 1 to 10 do
Cell(a,1):= a^2;
end;
END;

cyrille
Fantastic!
Thanks cyrille, but how to an external program enter the values in the spreadsheet sscpy?

Leo

12-09-2015, 08:10 PM
Post: #4
 Tim Wessman Senior Member Posts: 2,277 Joined: Dec 2013
(12-09-2015 11:11 AM)jrozsas Wrote:  Fantastic!
Thanks cyrille, but how to an external program enter the values in the spreadsheet sscpy?

That is what the line "Cell(...):=<stuff>" is doing.

Spreadsheet.Cell(1,3):='A1+A2' stores a formula into A3 that will add A1 and A2... and so on.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
12-09-2015, 08:32 PM
Post: #5
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-09-2015 08:10 PM)Tim Wessman Wrote:
(12-09-2015 11:11 AM)jrozsas Wrote:  Fantastic!
Thanks cyrille, but how to an external program enter the values in the spreadsheet sscpy?

That is what the line "Cell(...):=<stuff>" is doing.

Spreadsheet.Cell(1,3):='A1+A2' stores a formula into A3 that will add A1 and A2... and so on.
Tim,
Do you believe that in the manual in Portuguese, latest version, there is nothing about "Cell"? This information did you get to where? This is the only page that has some information about "Cell"

Leo

12-09-2015, 08:57 PM (This post was last modified: 12-09-2015 09:03 PM by Tim Wessman.)
Post: #6
 Tim Wessman Senior Member Posts: 2,277 Joined: Dec 2013
(12-09-2015 08:32 PM)jrozsas Wrote:  This information did you get to where?

The built in calculator help for "Cell references and Cell". You have about a page of text describing it there. To find it most easily, type "Cell" and press your calculator HELP key. It will take you right there where you will find this information:

Quote:In most cases, you will be referencing cells directly by their RC names as in A1 or D6 just like in your usual spreadsheet. Only advanced formulas creators or users that need access to spreadsheet data from outside of the spreadsheet numerical view will need to understand the full complexity of cell references.

Examples:
A1:= 100 stores the value 100 in cell A1.
A1:= A2+A3 stores value of A2+A3 in A1 using the current values of A2 and A3.
A1:= 'A2+A3' sets A1 to the formula A2+A3.

Syntax: Cell(RowNumber, ColNumber, [n])

For slightly more complex formulas, Cell(r, c) where r is a row number and c a column number (A=1, B=2 …) is equivalent to ColNameRowNumber. For example, Cell(1,1) is equivalent to A1.

Valid references are:

[$]R[$]C[(n)] or
[$]CellName[(n)] or [$]R1[$]C1:[$]R2[$]C2:[(n)] or [$]CellName1:[$]CellName2[(n)] or a mix of both name and RC syntaxes [$]R:[$]R[(n)] or RowName[(n)] or [$]C:[\$]C[(n)] or
ColName[(n)] or

Where R(1/2) is a Row name and C(1/2) is a Column name or number gives full access to a cell or selection definition or to the cell's attributes.

GETTING THE CONTENT OF CELLS AND SELECTIONS:
If n is not specified and the reference is not used as a Sto destination, the value of the cell/selection is returned.

If the reference is to a single cell, the cell value/content/attributes will be returned.
If the reference is to a single row or column, a list of value/content/attributes will be returned, one for each cell.
If the reference is to a selection, a list of list of value/content/attributes will be retuned, one for each column.
Note: a cell with no associated value is considered as having a value of 0.

If n is specified, the table bellow indicates what attribute of the cell will be returned.

MODIFYING THE CONTENT OF CELLS AND SELECTIONS:
If n is not specified and the reference is used as a Sto destination, the expression associated with the cell/selection is modified.

If a single input is used as the source for more than one destination, the input is duplicated for all destinations. If the input is an expression, relative cell references are updated as needed.
For example: A1:=1; A2:A10:='A1+1';

If n is specified, the table bellow indicates what attribute of the cell will be modified.

CELL ATTRIBUTES (n)
-1: all attributes. If the cell has nothing defined, returns -1, else return a list of 11 objects.
0: value (read only, you can not set the cell value)
1: formula
2: name
3: number format: Standard 0, Fixed 1, Scientific 2, Engineering 3, Floating 4, Rounded 5, unspecified –1
4: number of decimal places: 1 to 11, or unspecified = –1
5: font: -1: 0 to 6, unspecified = –1
6: foreground color: contents color (color, or -1 if unspecified)
7: background color: cell fill color (color, or -1 if unspecified)
8: horizontal alignment: Left = 0, Center = 1, Right = 2 , unspecified = –1
9: vertical alignment: Top = 0, Center = 1, Bottom = 2, unspecified = –1
10: show strings in quotes: Yes = 0, No = 1, unspecified = –1
11: textbook mode (as opposed to algebraic mode): Yes = 0, No = 1, unspecified = –1

Note: As a general rule, -1 means: unspecified or auto.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
12-09-2015, 11:27 PM
Post: #7
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-09-2015 08:57 PM)Tim Wessman Wrote:
(12-09-2015 08:32 PM)jrozsas Wrote:  This information did you get to where?

The built in calculator help for "Cell references and Cell". You have about a page of text describing it there. To find it most easily, type "Cell" and press your calculator HELP key. It will take you right there where you will find this information:

Quote:In most cases, you will be referencing cells directly by their RC names as in A1 or D6 just like in your usual spreadsheet. Only advanced formulas creators or users that need access
Interesting. In Portuguese is not the same. Note the differences in help menu> tree>search:
English:

Portuguese:

Is there any way to print everything this that help?

Leo

12-10-2015, 05:57 AM
Post: #8
 cyrille de brébisson Senior Member Posts: 1,047 Joined: Dec 2013
Hello,

In the emulator, with a help currently displayed, pressing Edit/copy should copy the whole help text in the PC clipboard.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
12-10-2015, 10:25 AM
Post: #9
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-10-2015 05:57 AM)cyrille de brébisson Wrote:  Hello,

In the emulator, with a help currently displayed, pressing Edit/copy should copy the whole help text in the PC clipboard.

Cyrille
But only with the help currently displayed? And print all the help (A-Z - all commands)? We could create a book with that help.

Leo

12-10-2015, 10:49 AM
Post: #10
 Thomas_Sch Senior Member Posts: 357 Joined: Dec 2013
(12-10-2015 10:25 AM)jrozsas Wrote:
(12-10-2015 05:57 AM)cyrille de brébisson Wrote:  Hello,
In the emulator, with a help currently displayed, pressing Edit/copy should copy the whole help text in the PC clipboard.
Cyrille
But only with the help currently displayed? And print all the help (A-Z - all commands)? We could create a book with that help.
12-10-2015, 06:47 PM
Post: #11
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-10-2015 10:49 AM)Thomas_Sch Wrote:
(12-10-2015 10:25 AM)jrozsas Wrote:  But only with the help currently displayed? And print all the help (A-Z - all commands)? We could create a book with that help.
I noticed something interesting. The "Cell" function does not exist in this PDF. Will other functions are also not in pdf?

Leo

12-11-2015, 06:54 AM
Post: #12
 Thomas_Sch Senior Member Posts: 357 Joined: Dec 2013
(12-10-2015 06:47 PM)jrozsas Wrote:  ..
I noticed something interesting. The "Cell" function does not exist in this PDF. Will other functions are also not in pdf?
We should ask Erwin (eried) in his thread. Maybe the App-functions are mising ?
12-11-2015, 08:32 AM
Post: #13
 Terje Vallestad Member Posts: 152 Joined: Dec 2013
(12-10-2015 06:47 PM)jrozsas Wrote:
(12-10-2015 10:49 AM)Thomas_Sch Wrote:  Erwin (eried) did this already:
I noticed something interesting. The "Cell" function does not exist in this PDF. Will other functions are also not in pdf?

The full Command Tree for 6975 (previous version) can be found in this post http://www.hpmuseum.org/forum/thread-2796.html
It includes the help for cell

Cheers, Terje
12-11-2015, 10:26 AM
Post: #14
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-10-2015 06:47 PM)jrozsas Wrote:  I noticed something interesting. The "Cell" function does not exist in this PDF. Will other functions are also not in pdf?

The full Command Tree for 6975 (previous version) can be found in this post http://www.hpmuseum.org/forum/thread-2796.html
It includes the help for cell

Cheers, Terje

THANKS Terje! Very important.Exactly what I was looking for.

Leo

12-14-2015, 11:51 AM
Post: #15
 toshk Member Posts: 194 Joined: Feb 2015
i have a list say L1={1,2,3,4} which can vary in size depending on the question.
i want to output this "variable list" into a spreadsheet column A. and possibly from an external app.

//this code crashes prime..............
for a:= 1 to length(L1) do
Cell(1,a):= L1(a);
end;
//...........................................
12-14-2015, 12:37 PM (This post was last modified: 12-14-2015 01:02 PM by jrozsas.)
Post: #16
 jrozsas Member Posts: 158 Joined: Nov 2014
(12-14-2015 11:51 AM)toshk Wrote:  i have a list say L1={1,2,3,4} which can vary in size depending on the question.
i want to output this "variable list" into a spreadsheet column A. and possibly from an external app.

//this code crashes prime..............
for a:= 1 to length(L1) do
Cell(1,a):= L1(a);
end;
//...........................................
Sintaxe: FOR var FROM início TO fim DO comandos END;
START()
BEGIN
local a;
for a:=1 to length(L1) DO
Cell(a,1):=L1(a);
END;
END;

Attached File(s)

Leo

12-14-2015, 09:37 PM
Post: #17
 Tim Wessman Senior Member Posts: 2,277 Joined: Dec 2013
I am unable to see this. I turned on Portuguese just to make sure language wasn't a part.

This was the code I tried in the spreadsheet app function. I had 1 2 3 4 in my list. I also tried with other values, and with an empty list. It works fine with either the Cell(a,1) or Cell(1,a)[/code]

Code:
START() BEGIN local a; for a:=1 to length(L1) DO Cell(1,a):=L1(a); END; END;

[code]
//this code crashes prime..............
for a:= 1 to length(L1) do
Cell(1,a):= L1(a);
end;
//...........................................

Am I misunderstanding you here?

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
12-14-2015, 11:27 PM (This post was last modified: 12-14-2015 11:31 PM by toshk.)
Post: #18
 toshk Member Posts: 194 Joined: Feb 2015

test values.....
gausss(M1,M3) to run;
type say vv to output a list...
this app has a lot of outputs , but i just want to tabular certain values in PFL sheet.
say busnumber in column A of PFL.
this

Attached File(s)
12-15-2015, 12:04 PM (This post was last modified: 12-15-2015 12:05 PM by jrozsas.)
Post: #19
 jrozsas Member Posts: 158 Joined: Nov 2014