CodeBase - 15 NEW Functions For FILE control(DBC and DBPRO - It Couldn't Get Any Easier!)

Return to the CodeBase listing

Category: File Control

Version: 1.0

0
0

Information

Uploaded: 14th Aug 2005 21:42

Modified: 14th Aug 2005 22:02

Author:  Underworld 1020

Summary

15 new functions for file control, including IncodeFile and DecodeFile! Here's the complete list: -PrintFileContentsToScreen : -IncodeFile : -DecodeFile : -GetRidOfBlankLines : -GetRidOfAllSpacesInFile : -GetRidOfStringAtStart : -GetRidOfStringAtEnd : -GetRidOfStringAtPos : -WriteStringToStart : -WriteStringToEnd : -WriteStringToPos : -Return Varible = CountLinesInFile : -Return Varible = ReadStringAtStart : -Return Varible = ReadStringAtEnd : -Return Varible = ReadStringAtPos :

Full Description

------------------------------------------<br /> <br /> -PrintFileContentsToScreen(File$,Top)<br /> <br /> This function allows you to print the complete contents of a specific file to the<br /> screen. However, keep in mind that only so many lines can be visible on the<br /> screen at one time. First type in the full name of the file whose contents you<br /> want to be displayed to the screen. Then you MUST type in a value of either 0 or 1.<br /> A 0 meaning that the Print will start where it left off, and a 1 meaning that the<br /> Print will start at the top of the screen.<br /> <br /> SYNTAX<br /> PrintFileContentsToScreen(string,interger)<br /> <br /> ------------------------------------------<br /> <br /> -IncodeFile(File$,Seed,Overwrite)<br /> <br /> This function will make it so that users won't be able to read your file or decode it.<br /> You first type in the full name of the file, then the SEED value. The seed value is a<br /> number that you make up to incode your file with, BE SURE to keep this number secret.<br /> A seed value of 0 will NOT incode the file, but completely erase everything in it, be<br /> sure not to use a seed value of 0. A SAFE range of SEED values would be between -99999<br /> and -1000, or between 1000 and 99999. Also keep in mind that the farther the seed<br /> value is from 0, the more it may take to incode the file. Next you type in either a 0,<br /> which saves the results of the file as a file named &quot;IncodedFile.dat&quot;, or you can type<br /> in a value of 1, which will overwrite the file that you are incoding.<br /> <br /> SYNTAX<br /> IncodeFile(string,interger,interger)<br /> <br /> ------------------------------------------<br /> <br /> -DecodeFile(File$,Seed,Overwrite)<br /> <br /> This function will allow you take a file that you've ALREADY incoded and translate it<br /> back into its original version. HOWEVER you must know the correct SEED value that you<br /> used to incode the file with or the results will NOT be even close to its original<br /> version. So, first type in the full name of the file, and then its SEED value. Next<br /> you type in either a 0, which saves the results of the file as a file named<br /> &quot;DecodedFile.dat&quot;, or you can type in a value of 1, which will overwrite the file that<br /> you are decoding.<br /> <br /> SYNTAX<br /> DecodeFile(string,interger,interger)<br /> <br /> ------------------------------------------<br /> <br /> -GetRidOfBlankLinesInFile(File$,Overwrite)<br /> <br /> This function will allow you to get rid of ALL blank lines in a file. First type in<br /> the full name of the file. Then you must type in either a 0, which saves the results<br /> of the file as a file named &quot;FileWithoutBlankLines.dat&quot;, or you can type in a value<br /> of 1, which will overwrite the file.<br /> <br /> SYNTAX<br /> GetRidOfBlankLinesInFile(string,interger)<br /> <br /> ------------------------------------------<br /> <br /> -GetRidOfAllSpacesInFile(File$,Overwrite)<br /> <br /> This function will allow you to get rid of ALL spaces in a file, INCLUDING blank<br /> lines First type in the full name of the file. Then you must type in either a 0,<br /> which saves the results of the file as a file named &quot;FileWithoutSpaces.dat&quot;, or<br /> you can type in a value of 1, which will overwrite the file.<br /> <br /> SYNTAX<br /> GetRidOfAllSpacesInFile(string,interger)<br /> <br /> ------------------------------------------<br /> <br /> -GetRidOfStringAtStart(File$)<br /> <br /> This function will allow you to get rid of the FIRST string at the start of a<br /> a specific file. Just type in the full name of the file.<br /> <br /> SYNTAX<br /> GetRidOfStringAtStart(string)<br /> <br /> ------------------------------------------<br /> <br /> -GetRidOfStringAtEnd(File$)<br /> <br /> This function will allow you to get rid of the LAST string at the end of a<br /> specific file. Just type in the full name of the file.<br /> <br /> SYNTAX<br /> GetRidOfStringAtEnd(string)<br /> <br /> ------------------------------------------<br /> <br /> -GetRidOfStringAtPos(File$,Pos)<br /> <br /> This function will allow you to get rid of a string at a certain POSITION in<br /> a specific file. First type in the full name of the file, then the position<br /> of the string that you want to get rid of. The position SIMPLY means which<br /> line number.<br /> <br /> SYNTAX<br /> GetRidOfStringAtPos(string,interger)<br /> <br /> ------------------------------------------<br /> <br /> -WriteStringToStart(File$,Write$)<br /> <br /> This function will allow you to write a string to the START of a file. First type in<br /> the full name of the file, then the string you want to be written to the start of the<br /> file.<br /> <br /> SYNTAX<br /> WriteStringToStart(string,string)<br /> <br /> ------------------------------------------<br /> <br /> -WriteStringToEnd(File$,Write$)<br /> <br /> This function will allow you to write a string to the END of a file. First type in<br /> the full name of the file, then the string you want to be written to the end of the<br /> file.<br /> <br /> SYNTAX<br /> WriteStringToEnd(string,string)<br /> <br /> ------------------------------------------<br /> <br /> -WriteStringToPos(File$,Write$,Pos,Overwrite)<br /> <br /> This function will allow you to write a string to a specific POSITION in a file.<br /> First type in the full name of the file, and then the string you want to be written<br /> to the file. Next you must type in the position you want the string to be written<br /> to in the file, this SIMPLY means, which line number you want the string to be<br /> written to in the file. Then you MUST type in a value of 0 or 1 for the Overwrite.<br /> A 0 meaning that the string that was previously at the specified position will not<br /> be over written, but pushed down to the next position in the file. And a 1 meaning<br /> that the string that was previously at the specified position will be overwritten<br /> by the new string.<br /> <br /> SYNTAX<br /> WriteStringToPos(string,string,interger,interger)<br /> <br /> ------------------------------------------<br /> <br /> -Return Varible = CountLinesInFile(File$,Rid)<br /> <br /> This function wiil allow you to RETURN the total number of strings in the specified<br /> file. First type in the full name of the file. Then you MUST type in a value of<br /> either 0 or 1 for the Rid. The Rid is used to compensate a BUG that is in both DBC<br /> and DBPRO, which is when a file is created with the Open To Write command an extra<br /> line is always created at the end of the file. Now this can cause many little errors,<br /> like returning the incorrect amount of lines in a file because that extra blank line<br /> at the end of the file that you did't intend to create will be counted as a line.<br /> HOWEVER, the typing in a value of 1 for the Rid will allow that extra line to not be<br /> counted in the total lines in the file. And a value of 0 will count that extra line<br /> at the end of the file. Remember that this function returns a interger, so you MUST<br /> act on that.<br /> <br /> SYNTAX<br /> interger varible = CountLinesInFile(string,interger)<br /> <br /> ------------------------------------------<br /> <br /> -Return Varible = ReadStringAtStart(File$)<br /> <br /> This function will allow you to RETURN the first string in a file. Just type in the<br /> full name of the file, and the FIRST string in the file will be returned. Remember<br /> this function returns a string, so you MUST act on that.<br /> <br /> SYNTAX<br /> string varible = ReadStringAtStart(string)<br /> <br /> ------------------------------------------<br /> <br /> -Return Varible = ReadStringAtEnd(File$)<br /> <br /> This function will allow you to RETURN the last string in a file. Just type in the<br /> full name of the file, and the LAST string in the file will be returned. Remember<br /> this function returns a string, so you MUST act on that.<br /> <br /> SYNTAX<br /> string varible = ReadStringAtEnd(string)<br /> <br /> ------------------------------------------<br /> <br /> -Return Varible = ReadStringAtPos(File$,Pos)<br /> <br /> This function will allow you to RETURN a string at a certain POSITION in a file.<br /> First type in the full name of the file, then the position where you want to read<br /> from. This SIMPLY means, which line number you want to read from. Remember that<br /> this function returns a string, so you MUST act on that.<br /> <br /> SYNTAX<br /> string varible = ReadStringAtPos(string,interger)<br /> <br /> ------------------------------------------

Comments

No comments yet.