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 / MyArray.Save("MyArray.json")

Author
Message
EricS2
6
Years of Service
User Offline
Joined: 17th May 2017
Location:
Posted: 26th Oct 2017 00:22
Impossible turn any array into json. The example in General folder do not work.



Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Oct 2017 09:11 Edited at: 26th Oct 2017 09:20
i saw an integer array was saved different, not json, but a type look saved like json.

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 26th Oct 2017 14:34
Works here, outputs the array surrounded by square brackets, e.g. "[1,2,3,4,5]", which is valid JSON. The JSON spec says it can either hold an object or an array.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Oct 2017 14:40
Quote: "which is valid JSON."

ahh you are right
Quote: "
JSON is built on two structures:
A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
"
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
EricS2
6
Years of Service
User Offline
Joined: 17th May 2017
Location:
Posted: 26th Oct 2017 18:27 Edited at: 26th Oct 2017 20:12
Turn the array into a string json using MyArray.toJSON is working, but where is the file "MyArray.json"? Its supposed to be on media folder right? I will look Markus example now... i will update soon here.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Oct 2017 20:42
Quote: "Its supposed to be on media folder right?"


It will be in the writeable media folder "C:\Users\[NAME]\AppData...." etc
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 26th Oct 2017 21:23
Is there a link to the doco for this?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Oct 2017 10:05
GetWritePath

Description

Returns the directory that new files will be written to on the current plaform that the app is running on.

Definition

string GetWritePath()
Click here for VR Legend of Zelda stuff
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Oct 2017 11:02
Sorry. I meant for the Json syntax. Is there a link for that?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Oct 2017 12:37
here:
http://json.org/
AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.9.3) Radeon R7 265 : Mac mini OS High Sierra (10.13)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Oct 2017 21:52
Maybe i'm missing something. Is there any documentation for the json syntax as implemented in AGK. Like the MyArray.ToJSON() function?
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 27th Oct 2017 22:25
I don't think any documentation has been published yet.

Login to post a reply

Server time is: 2024-04-25 10:41:56
Your offset time is: 2024-04-25 10:41:56