Get(BVar, loc)
Last updated November 15, 2002
Version: 1 | Requires: ColdFusion MX | Library: DataManipulationLib
Description:
This UDF will return the ASCII value of a specified character in a BINARY file.
(Get is a throwback to the BASIC days of GET/POKE for fetching/changing bytes in memory.)
Note: You may not change any value stored in the binary array - an error will occur.
Return Values:
Returns a string.
Example:
<cffile action="READBINARY" file="file name" variable="Data">
<CFLOOP index="loop" from="1" to="100">
<CFOUTPUT>#Chr(Get(Data,loop))#</CFOUTPUT>
</CFLOOP>
--->
Parameters:
| Name | Description | Required |
|---|---|---|
| BVar | Binary variable. | Yes |
| loc | Location in the binary file. | Yes |
Full UDF Source:
<cfscript>
/**
* Examine the contents of a BINARY file.
*
* @param BVar Binary variable. (Required)
* @param loc Location in the binary file. (Required)
* @return Returns a string.
* @author John Bartlett (jbartlett@strangejourney.net)
* @version 1, November 15, 2002
*/
function Get(BVar,loc) {
if (isBinary(BVar) EQ "No") return 0;
if (BVar[loc] GTE 0) return BVar[loc];
return BVar[loc] + 256;
}
</cfscript>
Search CFLib.org
Latest Additions
Dave Anderson added
iniToStruct
20 day(s) ago
Dave Anderson added
deDupeArray
20 day(s) ago
Richard added
dice
22 day(s) ago
Isaac Dealey added
getRelative
a while ago
Top Rated
backupDatabase
Rated 5.0, 22 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)
highlightAndCrop
Rated 5.0, 4 time(s)