06-15-2014, 03:40 AM (This post was last modified: 06-15-2014 03:46 PM by fabila.)
Post: #1
 fabila Junior Member Posts: 25 Joined: Dec 2013
sorry for my English
How to restart a spreadsheet or any app from a program?
thanks
06-15-2014, 04:23 PM (This post was last modified: 06-15-2014 04:23 PM by Angus.)
Post: #2
 Angus Member Posts: 212 Joined: Feb 2014
You can reset an app by pressing <DEL> in the Apps view. That will delete all variables.
06-15-2014, 04:58 PM
Post: #3
 fabila Junior Member Posts: 25 Joined: Dec 2013

but I think I explained wrong,

I want to reset the application using code, not using the buttons

thanks
06-15-2014, 07:00 PM
Post: #4
 Angus Member Posts: 212 Joined: Feb 2014
It don't know of a dedicated reset commands for apps (but I have still a way too limited Knowledge of the device)
However I would find no reason why you should not be able to purge a list of the needed Spreadsheet variables. Coded as a helper function would help to keep your Code clean.
06-16-2014, 02:52 AM
Post: #5
 Dougggg Member Posts: 64 Joined: Dec 2013
The spreadsheet is fairly easy to reset, it would appear that the spreadsheet data is stored as a list so you can clear it in your program with something like for example:

A1:m500={{}};

other apps might be harder to do that way if they have alot of varibles
06-16-2014, 05:50 AM
Post: #6
 cyrille de brébisson Senior Member Posts: 877 Joined: Dec 2013
Hello,

Sorry, but there is no way to do this programaticaly...

Someone already posted a trick that works for the spreadsheet, but it is not universal...

note that the spreadsheet does NOT store it's content as lists.. But only gives you the illusion that it does.

cyrille
06-16-2014, 03:19 PM
Post: #7
 fabila Junior Member Posts: 25 Joined: Dec 2013
thanks for your ANSWERS, I found this post but the solution is not for the fimware 6030

(02-19-2014 02:39 AM)josephec Wrote:  Dear All,

Inside a program you can use this syntax:

In ROM 5106:
(You can use it from command line too)

BUT in ROM 5447 it DOESN´T WORK,
then I asked to Cyrille and no response,... I have a large program with many methods that mix all results in the spreadsheet ... or the user need to ERASE IT BEFORE RUNNING THE PROG.

PLEASE CYRILLE What is the new SYNTAX ??

best regards!!
joseph
06-16-2014, 05:42 PM
Post: #8
 Dougggg Member Posts: 64 Joined: Dec 2013
I wrote a couple of programs that produce data that I felt that putting the data into a spreedsheat would be good, when synced with the connectivity kit you could copy the data to an excel spreedsheet and that works. I put the code for the calcs in the app. I think the best way to use the new empty spreadsheet app I created was to use it as a template so when I need to use the app I select it an save it with a different name and run it and generate the data.

my calculator still freezes when I use the program editor for a long period so hp still has work to do on the firmware, so maybe they could add a reset app command while there at it
06-16-2014, 06:44 PM
Post: #9
 eried Senior Member Posts: 721 Joined: Dec 2013
In RPN, oftenly when you are writing in a cell the calculator hangs and reboots and you lose all the data. But... it is not programatically :/

My website: erwin.ried.cl
06-16-2014, 06:50 PM
Post: #10
 fabila Junior Member Posts: 25 Joined: Dec 2013
the spreadsheet is a good tool to present the output of an external program, because we can interrelate the output data between themselves very easily
but if I can not reset the application from within the prgrama lose some functionality and it becomes tedious and use the programs.
06-17-2014, 05:30 AM
Post: #11
 cyrille de brébisson Senior Member Posts: 877 Joined: Dec 2013
Hello,

BTW, Cell(0,0,-1):={} would suffise...

Will NOT reset the spereadsheet, what it will do is that it will reset the cell 0,0, which correspond to the cell on the top left of the spreadsheet (the one with the HP logo)...

The original poster wants to reset the whole spreadsheet...
The best that I can think of to do this would be A1:ZZ9999(-1):={}

Cyrille
06-25-2014, 08:32 PM
Post: #12
 Jsather Junior Member Posts: 34 Joined: Apr 2014
(06-17-2014 05:30 AM)cyrille de brébisson Wrote:  The best that I can think of to do this would be A1:ZZ9999(-1):={}

The syntax "A1:ZZ9999(-1):={}" and variations referencing other cell ranges usually generate a "bad argument type" error in my attempts. As far as I'm concerned, fabila's very valid question remains unanswered: How can you clear cells of a spreadsheet from a program or Home screen command line?

Clearing would be the equivalent of selecting cells and pressing backspace. Cleared cells should take up no memory space and should return -1 when queried by Cell(R,C,-1). My own efforts to achieve this have been fruitless.
06-26-2014, 05:52 AM
Post: #13
 cyrille de brébisson Senior Member Posts: 877 Joined: Dec 2013
hello

Quote:The syntax "A1:ZZ9999(-1):={}" and variations referencing other cell ranges usually generate a "bad argument type" error in my attempts

Are you sure? it works here for me?
are you not doing somehting like A1:Z99 ? this one would cause an error as Z has to be lower case...

cyrille
06-26-2014, 02:38 PM
Post: #14
 Jsather Junior Member Posts: 34 Joined: Apr 2014
I was using lower case. I've attached some screen shots to show my environment.

Attached File(s) Thumbnail(s)

06-27-2014, 05:50 AM
Post: #15
 cyrille de brébisson Senior Member Posts: 877 Joined: Dec 2013
hello

(06-26-2014 02:38 PM)Jsather Wrote:  I was using lower case. I've attached some screen shots to show my environment.

how strange, it seems to work here for me...
and you are sure that "test" is a spreadsheet app?

can you try switching to the default spreadsheet app and try again?

cyrille
06-27-2014, 07:37 AM
Post: #16
 Thomas_Sch Senior Member Posts: 306 Joined: Dec 2013
Hello,
I tried "A23:D24:={}", this worked.
Combinations like "A23:D24(-1):={}" provided me with "Error: Bad argument type".

What does "..(-1)" mean?
06-27-2014, 02:26 PM
Post: #17
 fabila Junior Member Posts: 25 Joined: Dec 2013
(06-27-2014 05:50 AM)cyrille de brébisson Wrote:  hello

(06-26-2014 02:38 PM)Jsather Wrote:  I was using lower case. I've attached some screen shots to show my environment.

how strange, it seems to work here for me...
and you are sure that "test" is a spreadsheet app?

can you try switching to the default spreadsheet app and try again?

cyrille

This syntax does not work for me, I get the same error as Jsather

creating a loop reset 2 row and 20 columns, this works, but it is very far that we are looking for and also is very slow,

Code:
             FOR B FROM 2 TO SIZE(DIMENSIONES)+1 DO                 FOR C FROM 1 TO 20 DO                     Spreadsheet.Cell(B,C,-1):={"",−1,−1,−1,−1,32768,32768,1,−1,−1,−1};                 END;             END;
06-27-2014, 05:22 PM
Post: #18
 Jsather Junior Member Posts: 34 Joined: Apr 2014
Cyrille: Same "bad arguments" result with Spreadsheet app. At a more basic level I, was able to execute a1(-1):={} and it did not reset a1. Then I tinkered for a while and found things had changed so that "a1(-1):={}" or just entering "a1(-1)" would generate the "bad arguments" error. I do not know how to get out of this state, even starting with a new spreadsheet. Is there any chance you are working with a special calculator or special version of 6030/6031?

Thomas: (-1) references all the attributes of a cell such as formula, name, number format, etc. as described in the user manual page 209. You have managed to null out the cell formula so that blank is displayed and 0 is returned, but all the attributes are active and taking up memory space. Column 0 and Row 0 formulas will not take effect in the cells you have "reset" unless you manually select them and press backspace.

FYI the manual and "Cell" help screen describing foreground and background color indexes are reversed. Index 6 is foreground color and Index 7 is background (or fill) color.

fabila: You have set the value of the "reset" cells to "" which takes up memory and doesn't allow column 0, row 0 formulas to take effect, same as with the formula Thomas tried.

I know two quick ways to tell if a cell is reset. 1) Cell(R,C,-1) will return -1 rather than a list with 11 entries. 2) Enter a simple formula in row 0 or column 0. For example: Is D4 reset? At D0 enter "=Row". The row number will then be displayed in every cell, D1,D2,... that is reset. If any attribute is active, even if a cell just has a fill color, the row number is not displayed.

I do not mean to be dismissive of any efforts but hope everyone keeps trying and someone succeeds. I would greatly like to know why a1:zz9999(-1):={} works for Cyrille but not all of us.
06-27-2014, 05:44 PM
Post: #19
 Thomas_Sch Senior Member Posts: 306 Joined: Dec 2013