CodeBase - External File String Parser, Into Array.

Return to the CodeBase listing

Category: Functions

Version: 1.1

0
0

Information

Uploaded: 21st Oct 2003 08:39

Modified: 22nd Oct 2003 23:19

Author:  Jess T

Summary

These Functions Read data from an external file into arrays for easy access throughout your game.

Full Description

These functions are designed to wrok together, but can be used seperately if needed (That is why they are seperate and not all one function)<br /> <br /> The first Function reads the first character of every line in the external file to determine the data contained on that line. It then increases certain numbers etc which works out the amount of lines that have certain characters at the start of them.<br /> <br /> These values are then used to create an array that has the exact amount of elements needed to store the parsed data.<br /> <br /> The second Function parses the data in the external file into the array.<br /> To do this, it reads all the data up to the comma (,) and then stores that data into the first element of the array. The data between that comma (,) and the next is then read and stored into the next element of the array.<br /> <br /> NB: The data is stored in the array as strings, therefore, when you use the data to change values in your game, you need to put in the Val(string) command before using the values in the array as intergers. Otherwise you wil get errors.<br /> <br /> Thanks for looking at my code, don't forget to check out the forums for information on my upcoming game; HellBorn: Wounded Prey. This will be entirely open-source and available to everyone who want's to use it.

Comments

No comments yet.