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.

Windows / [SOLVED] Save to file - nothing happend

User Offline
Joined: 7th Feb 2020
Posted: 7th Feb 2020 15:14
Hi! I'm trying to save some informations to a text file but nothing happend when I run my code, my file (it's a simple test txt file in the root of my project) remains empty.

MY code contains nothing else just the sample code from AGK's website, so I belive its just a file authorization issue. I'm trying to change the file policies, but it wont helps.

The author of this post has marked a post as an answer.

Go to answer

Years of Service
User Offline
Joined: 20th Dec 2015
Posted: 7th Feb 2020 21:56 Edited at: 7th Feb 2020 21:57
This post has been marked by the post author as the answer.
AGK doesn't store files saved with OpenToWrite to your project's root folder unless you tell it to.

AGK Developer
Gold Codemaster
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Lakewood Ranch, FL
Posted: 7th Feb 2020 22:18

AGK saves the files to C:\Users\[USERNAME]\AppData\Local\AGKApps\[APPDIRNAME] because reasons.

hendron's code, above, is a short and sweet way to save files to, well... where most users would expect them to be.

Virtual Nomad
Years of Service
Recently Online
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Feb 2020 03:45
that code:

is also going to (try to) save the file every loop.
User Offline
Joined: 7th Feb 2020
Posted: 10th Feb 2020 09:15
@Virtual Nomad

yes I know. I'm just try this way as an experience.

@hendron, @loktofeit - THANK YOU.
Conjured Entertainment
AGK Developer
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 28th Feb 2020 01:28 Edited at: 28th Feb 2020 01:31
Quote: "I'm just try this way as an experience."

The experience is the best part of life.

Rock on brutha!

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2020-09-23 15:06:45
Your offset time is: 2020-09-23 15:06:45