EXAMPLE SOURCE CODE



 Load Text File To Array

By: Kevin Picone Added: May 28th, 2007

Category: All,Algorithm,Strings

This example looks the fastest way to load a text file into a string array in PlayBasic V1.62 and bellow. It includes two versions of the Loader function. The first reads the data to memory then manually grabs cuts and pastes this into the individual strings, the second read strings and throws them into the array directly. While the latter is less code, it's also dramatically slower! Around 50 times slower in fact. So if you need to load a text file into a string array, i'd recommend using the first version !


Note: I've include a second version of this bellow, LoadStringToArray_Faster.zip this version offers a few more methods on fast ways to load text files into an array.
Download: Login to Download





Release Type: The source code & tutorials found on this site are released as license ware for PlayBasic Users. No Person or Company may redistribute any file (tutorial / source code or media files) from this site, without explicit written permission.


 

 
     
 
       

(c) Copyright 2002 / 2024 Kevin Picone , UnderwareDesign.com  - Privacy Policy   Site: V0.99a [Alpha]