Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / deleting all temp resources created during runtime

Author
Message
haliop
User Banned
Posted: 24th Jun 2013 19:41
ok so ive managed to create files as one runs my app
but if he exits these files left as they were on the device
how would one delete all created assets ?

ive tried to add a function to delete all those files after the "loop" command (tier 1 ) but it showed an error while compiling where it took me to the last "include" file that it cannot end it or something .. i could post here what it wrote but i assume that you already know what im talking about .. so please can really use your help .. my app creates about 500 MB of files depends on the user and what he does with it... thank you for your time.
nadav.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Jun 2013 21:30
You should be able to use the DeleteFile command without any issues.

One of the things I discovered in including files is that you need to make sure that there is an end-of-line at the end of the file. That sounds like what you are running into.

And it is best to include files at the start of a file, not in the middle or end if you can help it.

Include files should contain only variable declarations or functions.

These are not rules of any sort, just things I've discovered that help things go smoothly.

(I never use GoSub as a matter of principle. I like my routines, whether they return something or not, to be totally contained. And GoSub with labels just doesn't work for me.)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 24th Jun 2013 21:32
Quote: "(I never use GoSub as a matter of principle. I like my routines, whether they return something or not, to be totally contained. And GoSub with labels just doesn't work for me.)"

I'm exactly the same. Functions allow for full code reuse. I like a plug & go style of coding.

This is my current project, check it out! [href]forum.thegamecreators.com/?m=forum_view&t=204576&b=8[/href]
This is my website, check it out! [href]http:\\www.TeamDefiant.co.uk[/href]
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 24th Jun 2013 22:03
I prefer gosubs lol, as I hate having to define variables as global or local. I'm just used to em I suppose. Swings and roundabouts..

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Jun 2013 22:21
Quote: "Swings and roundabouts."

Yup, it all comes down to personal preference.

Although, given the chance to instruct the uninformed, I probably never mention GoSub (Basic) or GoTo (lots of languages). Many languages have a subroutine (no return value) and a function (return value) format, even if they use the same reserved word for both.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
haliop
User Banned
Posted: 25th Jun 2013 10:44
i know i can use DeleteFile
but how can i delete all of them when the user stops the app process ? cause they are not deleted..

ive tried to add some lines after the "loop" command but it fails to compile..
if i'll do it in a function and then just call the function will it work? i am currently not working due to a recent hack i exprianced
will it work?
i need to clear all data created during the app runtime when a user quits the app totaly...

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Jun 2013 16:51
If they use anything but your 'close app' button (assuming you have something like that), you don't have any real options in Tier 1.

In Tier 2, you could put things in the app::End() method.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
haliop
User Banned
Posted: 25th Jun 2013 21:45
there must be a way...
cause if not then tier 1 is missing fundamentals in game making.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Jun 2013 22:12
Tier 1 is meant to be easy programming. Things like garbage collection aren't even mentioned.

Unfortunately, there is no way to pass or store a function reference in Tier 1, otherwise there could be an AppGameKit command to pass such a reference in and have that function called when the app is closed.

However, it is not necessarily true that the app even knows that it is going to be closed by some means other than a programmed function within itself (in response to a 'close app' type button).

That is the kind of communication from the OS to the app that may or may not happen.

But, in Tier 2 at least you can try by putting something in the app::end() method.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
haliop
User Banned
Posted: 25th Jun 2013 22:19
i will find a way around it
for now my project will stay on Tier 1 and i do it for the simple reason of being an expert in AppGameKit on both Tiers .. i already know C++ as the first years developing here i used DarkGDK rather then DBP
so im not really affriad of switching to tier 2 but i really really want to complete the first version of my proj on tier 1 then the second will be in tier 2

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Jun 2013 23:36
Expert in C++ is not the same as expert in AppGameKit Tier 2. I discovered that one the hard way.

I am in the process of doing the write up to go along with a complete Tier 2 example that demonstrates how to handle some things that get done differently in Tier 2 (and HTTP processing).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
haliop
User Banned
Posted: 26th Jun 2013 08:56
cool i would love to see it and learn .

Login to post a reply

Server time is: 2024-11-24 16:09:09
Your offset time is: 2024-11-24 16:09:09