Post Reply 
cant save grob
01-28-2016, 09:06 PM
Post: #1
cant save grob
AFiles ("pic"):= G0 seems to work

but

G0 := AFiles ("pic"); returns error, bad object type.

so how to save a grob?

I work with android Prime only for now on my
Galaxy Tab Pro/Note 2
Find all posts by this user
Quote this message in a reply
01-28-2016, 09:55 PM (This post was last modified: 01-28-2016 09:55 PM by Tyann.)
Post: #2
RE: cant save grob
Bonjour
Essayez
Code:
AFiles("pic.png"):=G0;
puis
Code:
 G0:=AFiles("pic.png";)
.

Sorry for my english
Find all posts by this user
Quote this message in a reply
01-28-2016, 10:31 PM
Post: #3
RE: cant save grob
addig .png or .PNG improves nothing. It doesnt work.
Try it.

I work with android Prime only for now on my
Galaxy Tab Pro/Note 2
Find all posts by this user
Quote this message in a reply
01-28-2016, 10:46 PM
Post: #4
RE: cant save grob
From the user guide (around page 412):

:=
Stores the evaluated expression in the variable. Note that:= cannot be used with the graphics variables G0–G9. See the command BLIT.
Find all posts by this user
Quote this message in a reply
01-29-2016, 06:08 AM (This post was last modified: 01-29-2016 06:28 AM by Tyann.)
Post: #5
RE: cant save grob
Bonjour
J'ai utilisé cette possibilité dans un de mes programmes
et cela fonctionne !

Hello
I used this opportunity in one of my programs
and it works !

Cet exemple simple fonctionne sur ma Prime :
This simple example works on my Prime:
Code:

EXPORT ESSAIG()
BEGIN
RECT_P();
TRIANGLE_P(10,10,280,80,20,160);
AFiles("V1"):=G0;
WAIT(2);
RECT_P();
WAIT(2);
G0:=AFiles("V1");
WAIT(-1);
END;

Sorry for my english
Find all posts by this user
Quote this message in a reply
01-29-2016, 07:16 AM
Post: #6
RE: cant save grob
This works for me (tested on the real Prime, the Windows emulator and the Android app):

Code:
EXPORT test1()
BEGIN
AFiles("pic.png"):=G0;
END;

EXPORT test2()
BEGIN
G0:=AFiles("pic.png");
FREEZE;
END;

Enter some data on your Home screen, run test1 then clear the Home screen and run test2. Press Home to return to the active screen.

However one thing to keep in mind is that AFiles and AVars scope is limited to the current active Application (as implied by their name).
If now you go to Apps, change the current application and go back to Home, test2 will return "Error: invalid input" as pic.png doesn’t exist for the new active application.
Find all posts by this user
Quote this message in a reply
05-10-2016, 10:26 PM (This post was last modified: 05-10-2016 10:39 PM by StephenG1CMZ.)
Post: #7
RE: cant save grob
(01-29-2016 07:16 AM)Didier Lachieze Wrote:  This works for me (tested on the real Prime, the Windows emulator and the Android app):

Code:
EXPORT test1()
BEGIN
AFiles("pic.png"):=G0;
END;

EXPORT test2()
BEGIN
G0:=AFiles("pic.png");
FREEZE;
END;

Enter some data on your Home screen, run test1 then clear the Home screen and run test2. Press Home to return to the active screen.

However one thing to keep in mind is that AFiles and AVars scope is limited to the current active Application (as implied by their name).
If now you go to Apps, change the current application and go back to Home, test2 will return "Error: invalid input" as pic.png doesn’t exist for the new active application.

I had read that AFiles were limited to an Application - and presumed that that meant that I couldn't use them in my program, which so far have been simple programs not requiring inclusion within an App.

But I just gave it a try, and was pleasantly surprised to discover that AFiles seem to work in ordinary programs. It might be worthwhile making that clearer in the documentation: you don't have to be using an App and a STARTVIEW to use AFiles. Or is it just me that misunderstood that?
(No sign of the .PNG in the Android gallery though Sad - only within the HP Prime emulator ).

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
05-11-2016, 05:50 AM
Post: #8
RE: cant save grob
Hello,

You can use the AFiles command anywhere...
BUT the file is 'linked' with the current application (hence the A for Application, in AFiles).

This means that if you switch app, the file will 'disapear' (well, it will not, of course, if you switch back to the original app, it will re-apear), but I hope that you understand the concept.

This is because application are directories, which means that they can host a collection of things (such as programs, notes and files), while programs are single files. so they can not have sub-files.

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.
Find all posts by this user
Quote this message in a reply
Post Reply 




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