≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Read binary files in CopperCube bin2cc released
Posted by:
(you are not logged in)
Enter the missing letter in: "Internati?nal"
(you are not logged in)
Text:
[quote][b]Robbo[/b] wrote: When saving I just have an array of data I want to save like this: var dat1 = invStats.toString(); ccbWriteFileContent('data/bin/invStats1.bin', dat1); Then when reloading it - to stop some problems like empty data files and causing issues plus converting numbers back to number format from a string do this: var invStats = []; var data = ccbReadFileContent('data/bin/invStats.bin'); if (data == null) {invStats.length = 0;} else {invStats = data.split(",");} var len = invStats.length; for (var i=0; i<len; i++) { if (!isNaN(invStats[i])) {invStats[i] = invStats[i] * 1;} }[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact