> -------------------------------------------------------------------------
> Function example start:
> -------------------------------------------------------------------------
> char	*file_select(char *path_p, char *mask_p)
> {
> 	char	fs_name[16];
> 	short	fs_retv, fs_exbt, fs_drive;
> 	char	*tempsp;
> 
> 	if((path_p == NULL) || (*path_p == 0))	/* default if no startpath given */
> 	{
> 		fs_drive = Dgetdrv();		/* find default drive */
> 		strcpy(path_p,"A:\\");		/* prepare path start */
> 		*path_p += (char) fs_drive;	/* fix default drive letter */
> 		Dgetpath(path_p+3, fs_drive+1);/* fill in default folder */
> 	}
> 	else					/* otherwise a path was given */
> 	{
> 		tempsp = strrchr(path_p,'\\');	/* find the filename part */
> 		if( tempsp == NULL )		/* if no backslashes found */
> 			return NULL;		/*   return NULL as error */
> 		strcpy(fs_name, tempsp+1)	/* copy the name found */
> 		tempsp[1] = 0;			/* and cut it from path */
> 	}
> 
> 	if( path_p[strlen(path_p)-1] != '\\' )	/* if the path has no trailslash */
> 		strcat(path_p, "\\");		/* add one backslash to it */
> 	
> 	if((mask_p == NULL) || (*mask_p == 0))	/* if no mask given */
> 		strcat(path_p, "*.*")		/*   use *.* as mask */
> 	else					/* otherwise */
> 		strcat(path_p, mask_p);		/*   use the given mask */
> 
> 	fs_retv = fsel_input(path_p, fs_name, &fs_exbt);	/* call GEM */
> 
> 	tempsp = strrchr(path_p,'\\');		/* find mask start in path */
> 	if( tempsp == NULL )			/* if that mask is gone !!! */
> 		return NULL;			/*   return NULL as error */
> 	tempsp[1] = 0;				/* cut the mask from path */
> 	strcat(path_p, fs_name);		/* add the filename to path */
> 
> 	if( fs_retv < 0  ||  fs_exbt == 0  ||  *fs_name == 0)
> 		return NULL;			/* return NULL on Cancel etc */
> 
> 	return path_p;		/* return path_p to caller */
> }
> -------------------------------------------------------------------------
> Function example end:
> -------------------------------------------------------------------------
