/ Prepare the column file name pattern for a split table. */ This function returns the number of columns of the table. */ /
| 171 | /* This function returns the number of columns of the table. */ |
| 172 | /***********************************************************************/ |
| 173 | int VCTDEF::MakeFnPattern(char *fpat) |
| 174 | { |
| 175 | char pat[16]; |
| 176 | #if defined(_WIN32) |
| 177 | char drive[_MAX_DRIVE]; |
| 178 | #else |
| 179 | char *drive = NULL; |
| 180 | #endif |
| 181 | char direc[_MAX_DIR]; |
| 182 | char fname[_MAX_FNAME]; |
| 183 | char ftype[_MAX_EXT]; // File extention |
| 184 | int n, m, ncol = 0; |
| 185 | PCOLDEF cdp; |
| 186 | |
| 187 | for (cdp = To_Cols; cdp; cdp = cdp->GetNext()) |
| 188 | ncol++; |
| 189 | |
| 190 | for (n = 1, m = ncol; m /= 10; n++) ; |
| 191 | |
| 192 | snprintf(pat, sizeof(pat), "%%0%dd", n); |
| 193 | _splitpath(Fn, drive, direc, fname, ftype); |
| 194 | strcat(fname, pat); |
| 195 | _makepath(fpat, drive, direc, fname, ftype); |
| 196 | PlugSetPath(fpat, fpat, GetPath()); |
| 197 | return ncol; |
| 198 | } // end of MakeFnPattern |
| 199 | |
| 200 | /***********************************************************************/ |
| 201 | /* GetTable: makes a new Table Description Block. */ |
no test coverage detected