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 / Can i populate a spreadsheet?

Author
Message
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 13th Mar 2016 12:02
Using Windows and Tier 1, I would like to be able to populate a spreadsheet from AGK2.

Using DBPro, and help from the forum, I was able to do this using VB, but without an "execute file" option in AGK2 this method does not appear possible.

Any thoughts or ideas?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Mar 2016 13:24
Xlsx format spreadsheets are just xml files stored in a renamed zip file. AppGameKit has the ExtractZip command, so you could get the contents, update the relevant xml file, then CreateZip to package it all back up.

So the answer is yes. AppGameKit *could* update spreadsheets.
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 13th Mar 2016 13:57
Hi Mobiius, this certainly looks promising. I will need to play around with it a while but basically sounds straight forward.

Many thanks for your comments, appreciated as always.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Mar 2016 15:44
You could also use the C# .NET wrapper. It doesn't have to be an AppGameKit app inside a .NET app. You could launch it as a local server, processing your data from AGK.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 13th Mar 2016 16:04
Quote: "You could also use the C# .NET wrapper"

Hi BatVink, this sounds interesting but I am way out of depth with any C# and afraid that I just don't understand your suggestion. Sorry for asking but do you know of any thread or tutorial on this that may help me?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Mar 2016 21:28 Edited at: 13th Mar 2016 21:29
The framework is here, with an intro video.
You don't need too much C# knowledge. The video and code shows an AppGameKit app inside a .NET app. But you could launch the .NET app, which launches a separate AppGameKit app then minimises itself. This way, they are both aware of each other and can communicate.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 14th Mar 2016 09:36
@BatVink, many thanks for the link and additional comments which should help me. I am going to try it as I have encountered an obstacle with the solution provided by Mobiius, and will let you know how I get on.

@Mobiius, thank you again for your suggestion. I have tried it and to a point it works very well. The main problem that it causes me is that string$ entries are placed in a different file to the integer entries and then cross-referenced with an integer number which will make updating difficult but not impossible. I will look at it again to see if I can find a simple method to update all types of formatted entries.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 14th Mar 2016 12:23
a ShellExecute (Win32 API) is in the v2 Feature Requests list.
with it would be possible to start a created csv file with assigned app for this extension.

Quote: "Xlsx format spreadsheets are just xml files stored in a renamed zip file."

interesting
AGK (Steam) V2.0.17 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 14th Mar 2016 16:19
Quote: "a ShellExecute (Win32 API) is in the v2 Feature Requests list"
, I think it has been overlooked again, no comment from Paul today.

Just a quick note for anyone trying the suggestion by Mobiius, for extraction the file extension needs to be changed from .xlsx to . zip and later back again to view the updated spreadsheet.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 21st Mar 2016 14:21
The following commands will be in the next version. Currently they are Windows only, if I have time I'll have a look at other platforms.
appID = RunApp( filename, parameters )
int GetAppRunning( appID )
TerminateApp( appID )
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 21st Mar 2016 16:18 Edited at: 21st Mar 2016 20:15
Quote: " C# .NET wrapper"

I'm afraid I am finding this a little too complicated and user unfriendly, although it is clearly a clever tool. I think it would take me longer to get ok with it than it did to get ok with AppGameKit, so sorry but thank you.

Quote: "Xlsx format spreadsheets are just xml files stored in a renamed zip file"

I had started to write a function that could create or modify a spreadsheet using the unzipped files but after the good news from Paul today I may wait a little. thank you also for the information that you provided.

Quote: "The following commands will be in the next version"

Oh wow, thank you Paul, really appreciated.
This is the better option for me at this time.

Thank you all for helping.

Login to post a reply

Server time is: 2024-09-29 13:34:03
Your offset time is: 2024-09-29 13:34:03