Sign in to follow this  
Followers 0
Truffle

My INI file got too big!

30 posts in this topic

Hello!

A program I wrote reads an INI file, which just grew to 69KB in size. I just found out that 98/ME users get an error after the program refers to anything past that 64KB buffer thingy.

XP works though, since Microsoft seems to have dropped that limit. But do you guys know of a way I can get around this? Most of the people that use this program run Windows 9x.

Thanks!

Share this post


Link to post
Share on other sites



it would be cool i if i could get it to query my MySQL server on my web host.. But i dont think thats possible is it?

Share this post


Link to post
Share on other sites

you could basicly do the same thing with a flat file or your current ini file

example

file=somefile

then read each line in using filereadline, then split the line using the "=" as the splite char.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

you could basicly do the same thing with a flat file or your current ini file

example

file=somefile

then read each line in using filereadline, then split the line using the "=" as the splite char.

<{POST_SNAPBACK}>

Here's a sample of the INI file im using

[version]

numMaps=218

[zips]

1=demoranch.zip

2=spacewar.zip

3=oltown.zip

4=olcity.zip

5=ctfxmas.zip

6=alamo.zip

7=barn1.zip

8=beerformyhorses.zip

9=bigstick.zip

10=bluwater.zip

Its updated twice a month with long paragraphs in the bottom section there are currently 1762 lines

Think it's possible in the beta version.

i think i saw some talk about MySQL but it had to be installed on the machine the program was running from with the ODBC driver?

Share this post


Link to post
Share on other sites

Haven't looked into it, but I'm sure you would need the odbc driver on the client machine.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Is your file just a flat list of ZIP files? Then why not just make it a plain text file containing the list, and use _FileReadToArray() to get the list when you need it?

Share this post


Link to post
Share on other sites

After I complete AutoIt functions FileHash(), and StringHash(), I do believe I am going to take on the massive project of MySQL and AutoIt integration.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Is your file just a flat list of ZIP files?  Then why not just make it a plain text file containing the list, and use _FileReadToArray() to get the list when you need it?

<{POST_SNAPBACK}>

Sorry the example i posted was not a good one... Attached is the whole INI file.(renamed to txt because board wouldnt allow ini to be uploaded)

The largest section is the [mapinfo] section as it contains a review of each of the levels for the game.

After I complete AutoIt functions FileHash(), and StringHash(), I do believe I am going to take on the massive project of MySQL and AutoIt integration.

JS

That sounds really cool!

maplist.txt

Edited by Truffle

Share this post


Link to post
Share on other sites

It looks like you're trying to use an INI file as a data base. You'd probably be better off using a CSV file.

I'd use 2 files, one for your maps and the other for your authors/reviewers:

[Mapsfile]

zipfile,filesize,mapname,authornumber,screenshot,modes,reviewernumber,mapinfo

Example line:

demoranch.zip,14KB,Demolition Ranch,1,demoranch.jpg,31,1,Small DM arena map designed for Sanchez/Dynamite matches only

[NamesFile]

AuthorNumber,AuthorName,ContactInfo,etc...

1,Truffle,truffle@truffle.com,etc...

and the 31 in the mapsfile example is a binary flag value to say that the map supports all 5 game modes.

Share this post


Link to post
Share on other sites

It looks like you're trying to use an INI file as a data base.  You'd probably be better off using a CSV file.

I'd use 2 files, one for your maps and the other for your authors/reviewers:

[Mapsfile]

zipfile,filesize,mapname,authornumber,screenshot,modes,reviewernumber,mapinfo

Example line:

demoranch.zip,14KB,Demolition Ranch,1,demoranch.jpg,31,1,Small DM arena map designed for Sanchez/Dynamite matches only

[NamesFile]

AuthorNumber,AuthorName,ContactInfo,etc...

1,Truffle,truffle@truffle.com,etc...

and the 31 in the mapsfile example is a binary flag value to say that the map supports all 5 game modes.

<{POST_SNAPBACK}>

so to get around the 64K limit with CSV would i have to have the users set up a System DSN in ODBC? Or how would I do this?

Thanks

Share this post


Link to post
Share on other sites

Contrary it seems to popular belief (or atleast in this thread) a cvs isnt a database. It is an organized way of storing data outside of an actual database.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

hows-about this idea

$days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",")
;$days[1] contains "Sun" ... $days[7] contains "Sat"

for $x = 1 to $days[0]
MsgBox(0,"data as split", $days[$x] & @CRLF & "is number: " & $x & "  " )
Next

hope it helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Contrary it seems to popular belief (or atleast in this thread) a cvs ...<{POST_SNAPBACK}>

You mean CSV. Comma Seperated Values. :dance:

Truffle, these guys are still talking about a file, like info.txt, or maps.txt, etc. Just writing it different, and setting up your own parsing functions instead of using the INI ones.

Running with blindwig's example, I created the attached code, have a look at it and try it out. Also look at maps.txt for an example of how to format the file. I varied from blindwig's idea in that I used TAB's as seperators instead of commas, because you use commas in your descriptions so it would have messed everything up. And I also put the author/reviewer names right into the maps.txt instead of having a seperate file to read the info from. That's getting a little more complicated and I figured I'd let you wrap your head around this much of it first. :whistle:

*Edit: I guess if I mention attached code I should actually attach it, eh?

Edited by Saunders

Share this post


Link to post
Share on other sites

You mean CSV. Comma Seperated Values. :dance:

Truffle, these guys are still talking about a file, like info.txt, or maps.txt, etc. Just writing it different, and setting up your own parsing functions instead of using the INI ones.

Running with blindwig's example, I created the attached code, have a look at it and try it out. Also look at maps.txt for an example of how to format the file. I varied from blindwig's idea in that I used TAB's as seperators instead of commas, because you use commas in your descriptions so it would have messed everything up. And I also put the author/reviewer names right into the maps.txt instead of having a seperate file to read the info from. That's getting a little more complicated and I figured I'd let you wrap your head around this much of it first. :whistle:

*Edit: I guess if I mention attached code I should actually attach it, eh?

<{POST_SNAPBACK}>

Yes, CSV :dance:. I have been on Fedora Core 4 alot recently.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Being an opportunist, I wanted to put in a plug here for a thought I dropped in to the Idea Lab some time ago for creating an XML variant of an INI file:

XML Ini Files

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Being an opportunist, I wanted to put in a plug here for a thought I dropped in to the Idea Lab some time ago for creating an XML variant of an INI file:

XML Ini Files

Dale

<{POST_SNAPBACK}>

Interesting concept. Would like to help with it but I have no idea on where to start. Infact, I'm not even sure if I quite understand XML.

It's like your own custom HTML tags that are only interpreted by your app right?

Share this post


Link to post
Share on other sites

Truffle, these guys are still talking about a file, like info.txt, or maps.txt, etc. Just writing it different, and setting up your own parsing functions instead of using the INI ones.

Yeah I knew that part... But, what I wasnt sure about was if the CSV file gets over 64K wont I have the same problems? Only one way to find out I guess... And that's to try it.

I asked about ODBC because I went in to ODBC connector and saw that CSV and TXT files were both in the drivers list. Thought maybe Windows may handle it a little different if it were setup as a "data source" rather than just a notepad file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0