GetProStrg( )

Microsoft Visual FoxPro Foxtools

GetProStrg( )

Retrieves the string associated with an entry within the specified section in the Win.ini initialization file.

Syntax

GetProStrg (lpszSection, lpszEntry, lpszDefault,
@lpszReturnBuffer, cbReturnBuffer)

lpszSection

Points to a null-terminated string that specifies the section containing the entry.

LpszEntry

Pointer to the null-terminated string containing the entry whose associated string is to be retrieved. If this value is NULL, all entries in the section specified by the lpszSection argument are copied to the buffer specified by the lpszReturnBuffer argument.

LpszDefault

Pointer to the default value for the given entry if the entry can't be found in the initialization file. This argument must never be NULL; it must point to a valid string, even if the string is empty (its first character is zero).

lpszReturnBuffer

Pointer to the buffer that will receive the character string.

cbReturnBuffer

Specifies the size, in bytes, of the buffer pointed to by the lpszReturnBuffer argument.

Return Value

Numeric

Remarks

An application can use the GetProStrg( ) function to retrieve a string from a specified file.

If the lpszEntry argument is NULL, the GetProStrg( ) function copies all entries in the specified section to the supplied buffer. Each string will be null-terminated, with the final string terminating with two null characters. If the destination buffer is too small to hold all the strings, the last string will be truncated and followed by two terminating null characters.

If the string associated with lpszEntry is enclosed in single or double quotation marks, the marks are discarded when GetProStrg returns the string.

GetProStrg( ) isn't case dependent, so the strings in the lpszSection and lpszEntry arguments may contain a combination of uppercase and lowercase letters.

The return value is the number of bytes copied to the buffer, not including the terminating zero, if the function is successful.