BIN2I() | Convert a 16-bit signed integer to a numeric value |
BIN2L() | Convert a 32-bit signed integer to a numeric value |
BIN2W() | Convert a 16-bit unsigned integer to a numeric value |
ERRORBLOCK() | Post a code block to execute when a runtime error occurs |
FN_BIN2HEX() | Convert a binary string to hexidecimal |
FN_BIN2I() | Convert a binary string to numeric |
FN_CLRBIT() | Clear a bit in a number |
FN_ERROR() | Return current error status for a Netware Library function |
FN_HEX2BIN() | Convert a hexidecimal string to to binary |
FN_I2BIN() | Convert an integer to binary string |
FN_IPXINIT() | This function gets the entry address for the IPX interface. |
FN_IS3X() | Is the current server a 3.x server? |
FN_ISBIT() | Determine if a specified bit is set |
FN_ISNET() | Determine if user is on functioning NetWare node |
FN_NAMEL() | General purpose string to length+string packet function |
FN_NONULL() | Strip a string of trailing nulls |
FN_PEEKSTR() | Read a string of bytes from memory |
FN_PFEVAL() | Set preferred server and eval block |
FN_POKESTR() | Write a string of bytes to memory |
FN_SETBIT() | Set a bit in a number |
_FNSETERR() | Set the current Netware Library error status |
FN_SSFROMP() | Remove the file server name from a path string |
FN_TOGBIT() | Toggle a bit in a number |
I2BIN() | Convert a xClipper numeric to a 16-bit binary integer |
L2BIN() | Convert a xClipper numeric value to a 32-bit binary integer |
PCOUNT() | Determine the position of the last actual parameter passed |
PROCLINE() | Return the source line number of the current or previous activation |
PROCNAME() | Return the name of the current or previous procedure or user-defined function |
VERSION() | Returns xClipper version |
fn_Bin2I( <cBinStr> ) -> cHexStr
A string containing the hexdecimal value of <cBinStr>.
Internally, all information is stored as a series of bytes. When performing a direct read from memory, a character string will be returned. Use this function to convert that string to its hexidecimal numeric equivalent.
/* convert a string containing CHR(0)+CHR(0)+CHR(222)+CHR(175) */ ? fn_Bin2Hex( CHR(0)+CHR(0)+CHR(222)+CHR(175) ) // " DEAF"
fn_Bin2I( <cBinStr> ) -> nValue
The decimal value of <cBinStr>.
Internally, all information is stored as a series of bytes. When performing a direct read from memory, a character string will be returned. Use this function to convert that string to its Clipper numeric equivalent.
This function only returns integer values.
/* convert a string containing CHR(0)+CHR(0)+CHR(222)+CHR(175) */ ? fn_Bin2I( CHR(0)+CHR(0)+CHR(222)+CHR(175) ) // 57007
fn_clrbit( <nNum>, <nBit> ) -> nResult
<nResult>, a numeric
Clears a specified bit in a number.
fn_clrbit( 9, 0 ) // 8 (clears bit 0)
fn_error() -> nError
No arguments
<nError>, a numeric error code. Details on the error codes can be found...
fn_Hex2Bin( <cHexStr> ) -> cBinStr
A binary string representing the value passed.
This function converts a hexidecimal value to it binary equivalent, and is useful for doing a direct memory translation.
? fn_Hex2Bin( "DEAF" ) ? fn_Hex2Bin( "10" )
fn_I2Bin( <nValue>, [ <nLen> ] ) -> cBinStr
<nValue> | is the integer to convert. Only positive integers may |
be converted. | |
<nLen> | is the desired resultant string length. If omitted, it |
defaults to the length required to represent <nValue>. If <nLen> | |
is larger than the length required to represent <nValue>, cBinStr | |
is left-padded with CHR(0)'s to fill it out to the desired length. | |
A binary string representing the value passed.
This function converts a decimal value to it binary equivalent, and is useful for doing a direct memory translation.
? fn_I2Bin( 57007 ) ? fn_I2Bin( 57007, 4 )
Fn_IPXInit() -> lInit
No arguments
<lInit> - Whether IPX has been initialised. If <lInit> is false check Fn_Error() for the error code which could be one of:
[ Error codes here ]
This function initializes an array in the library with the address of the IPX services. This function must be called before any of the IPX functions in this library can be performed.
[This function is meant to be part of a larger suite but the code wasn't ready by the release date. In its present form, it can be used to determine if IPX is installed, which might be useful.]
If ( Fn_IPXInit()) ? "IPX installed" EndIf
fn_is3x() -> lIs3X
No arguments
.t. if the server is a 3.x server, .f. if it isn't
A simple function that wraps around FN_GETFSI(). Determines whether or not the current server is a NetWare 3.x server or not.
if fn_is3X() qout( "You're on NetWare 3.x" ) endif
fn_isbit( <nNum>, <nBit> ) -> lSet
Returns logical .t. if the bit is set, .f. if it isn't.
Determines if a specified bit in a number is set.
? fn_isbit( 13, 0 ) // .t. (bit 0 is set)
fn_isNet() -> nStatus
No arguments
<nStatus>, a numeric, which will be one of:
0 User has shell loaded and is logged in 1 User hasn't loaded IPX 2 User hasn't loaded a shell 3 User is not attached to a server 4 User has no connection id (?) 5 User is not logged in
fn_isNet() provides a simple way to determine if the user running your program is logged in. if fn_isNet() == 0, she's in.
if !fn_isNet() qout( "This program requires Novell NetWare." ) endif if fn_isNet() qout( "This is not a network version!" ) ft_reboot() // Take that! endif
fn_NameL( cName, nRequiredLength) => cReturn
<cReturn> - a character string with a one byte word at the beginning which indicates the string length, including a null terminator which is added if it does not exist.
There are numerous places where a character string that is sent needs to be encoded with a leading BYTE specifying the length and may also need to be padded with NULLs.
A terminating null is guaranteed.
If the Length of cName is greater than nRequiredLength -1, it is truncated to leave room for the terminator.
fn_noNull( cStr ) -> cNewStr
<cNewStr>
Given a string <cStr>, fn_noNull() strips any trailing NULLs, [ chr(0) ] from the end. If there are no nulls, the entire string is returned.
fn_PeekStr( <nSegment>, <nOffset>, <nLength> ) -> cBinStr
A string containing the characters found at <nSegment>:<nOffset>.
Use this function to perform memory reads of a contiguous block of memory. The string returned contains one character for each byte of memory read.
If you plan to perform consecutive memory reads from memory, for instance in filling an array, pass <nOffset> by reference to keep it updated in the calling routine.
/* fill an array with 8-bytes taken from a block in memory */ ARRAY( aMemValues, 10 ) // create a Clipper array nSeg := <...> // initialize pointers to nOff := <...> // desired memory location AEVAL( aMemValues, {|e| e = fn_PeekStr( nSeg, @nOff, 8 ) }
fn_pfEval( xID, bBlock ) -> xRet
<xID> | can be numeric, or a character. |
If it's numeric, it is the connection ID of the server you want | |
to set to before evaluating <bBlock>. This is is position of | |
the server in the server name table. You can use FN_FSNAME() | |
to find a connection ID, given a server name. If the | |
connection ID is invalid, the current connection ID is used. | |
If it's a character, it is the _name_ of the server you want | |
to set to before evaluating <bBlock>. If the server name is | |
invalid or not found, the current server is used. | |
<bBlock> | is a code block to evaluate. |
<xVal>, whatever is returned from the block when it is evaluated.
Some APIs require you to set to a preferred connection ID first before they can be executed. This call just simplifies the process of getting the old ID, setting the new one, doing something, then resetting the old ID.
This function records the state of fn_error() after evaluating the block and makes sure it stays that way before returning. Therefore, you can't really know whether or not the calls to change the preferred server back and forth are working or not, as there is no way to access their return values.
fn_PokeStr( <nSegment>, <nOffset>, <cBinStr> ) -> NIL
Nothing.
Use this function to perform memory write to a contiguous block of memory.
If you plan to perform consecutive memory write to memory, for instance in copying an array of binary strings to memory, pass <nOffset> by reference to keep it updated in the calling routine.
/* write an array to a block in memory */ nSeg := <...> // initialize pointers to nOff := <...> // desired memory location AEVAL( aMemValues, {|e| fn_PokeStr( nSeg, @nOff, e ) }
fn_setbit( <nNum>, <nBit> ) -> nResult
<nResult>, a numeric
Sets a bit in a number.
? fn_setbit( 12, 0 ) // 13 (sets bit 0)
_fnSetErr( nErrCode ) -> nOldError
<nOldError>
Fn_SSFromP( <cFullPath>,<@cServerName> ) -> cStrippedPath
<cStrippedPath> - <cFullPath> less <cServerName>.
This function strips the server name from the specified path. If the path does not include a file server specification, then the function returns the original path.
cStripped := Fn_SSFromP( "FS1/SYS:\PUBLIC",@cServer ) ? cStripped // "SYS:\PUBLIC" ? cServer // "FS1"
fn_togbit( <nNum>, <nBit> ) -> nResult
<nResult>, a numeric
Toggles bit <nBit> in number <nNum>.
? fn_togbit( 9, 0 ) // 8 (toggles bit 0 )