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 / Really?!? This is sort of minor, but annoying

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th May 2013 22:38
While adding a game save/restore feature, I needed to be able to delete a file.

No biggy, there is a DeleteFile command, right?

Except, in Windows it is apparently 'DeleteFileA'.

And for all other platforms it is 'DeleteFile'.

Okay, so #ifdef makes it better.

But, really now, this should not happen.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 29th May 2013 23:33
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 30th May 2013 00:50
That's a straight pass-through of the Windows API. DeleteFileA is an ANSI filename, DeleteFileW is a Unicode filename, and DeleteFile is the default for that compiler.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2013 04:51
Maybe.

But the commands I have to use are 'agk:eleteFileA("file")' and 'agk:eleteFile("file")'.

Given that there is no distinction for platform in the C++ version of the online help, you'd think that the agk:: command would be consistent.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 30th May 2013 10:12
True. That should be fixed ASAP.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2013 18:19
The AppGameKit command is agk:eleteFile( const char* ) on all platforms. Windows is using a define to make it look like DeleteFileA but if you look at the definition in Wrapper.h it is actually DeleteFile.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2013 18:42
Ahh!!

When I was typing in the command, the list that displayed did NOT show 'DeleteFile'. It only showed 'DeleteFileA'.

But, just now, after ignoring what was shown and simply leaving it at 'DeleteFile', it compiled just fine.

So, it is a Visual Studio quirk.

Thank you for correcting me.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-04 19:25:06
Your offset time is: 2024-05-04 19:25:06