[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function getfname - get a filename from the keyboard
Syntax int getfname(byte row, byte col, char *returnstr,
char *pattern, int argn, int argk[],
char flags);
Prototype in video.h
Remarks getfname calls getget() asking for input of a
length 12 string, at the coordinates (col,row),
including pattern formatting and optional input
exit keys listed in argk. If memory was allocated
for returnstr, the string pointed to by returnstr
is checked to see if it is a valid DOS filename. A
valid filename must be of the form
[filename] [.] [ext] and does not contain
any of the following:
[ ] ; , . / ? * : " + = - < > \ |
If memory could not be allocated for the string,
returnstr will be set to NULL.
For more info on pattern and argk requirements,
check the stats for getget().
Return value if memory could not be allocated for returnstr or
the string pointed to by returnstr is not a valid
filename, -1 is returned, otherwise the key used to
exit the input is returned.
See also getget()
Example #include <filehk.h>
#include <keycode.h>
main()
{
char *fname;
int keys[2]={ESC,F10}; /* ESC & F10 exit
input */
gotoxy(0,0);
printf("Enter file: ");
if (getfname(0,13,fname,"!",2,keys) == -1)
printf(" BAD FILENAME");
else
printf(" valid filename");
}
Program output
See Also:
getget()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson