Re: Running PFFs on a server
Posted: February 24th, 2013, 3:30 pm
To be more precise, when a keyer start a session, he must enter the first letters of his first and last name: say AB for example. The first time, a .dat file is created named after his ID, here it would be AB.dat. Main files are on the server side and as many as there are keyers of course. Next time AB open a session, his .dat file is backed up (copied) using "filecopy", so there is always a copy of the last .dat file. But the .dat file is backed up before starting entering new data. The server is also backed up every night.
The menu starts with this kind of code. This is not the final one but it might give you an idea.
It is largely inspired by one of the many exemples Gregory had shared with us on this forum.
The menu starts with this kind of code. This is not the final one but it might give you an idea.
It is largely inspired by one of the many exemples Gregory had shared with us on this forum.
Code: Select all
PROC GLOBAL
alpha (50) pffFileName = "launcher.pff";
alpha (50) tablesFileName = "Tables.tbw";
alpha (50) dataFileName;
file pffFile;
//Local folders
alpha (300) dataFolderName = "..\\Data";
alpha (300) htmlFolderName = "..\\HTML";
alpha (300) entryFolderName = "..\\Entry";
alpha (300) manualFolderName = "..\\Manual";
alpha (300) batchFolderName = "..\\Batch";
alpha (300) tabulationFolderName = "..\\Tabulation";
alpha (300) tablesFolderName = "..\\Tables";
//Remote folder (NETWORK)
//alpha (300) remoteDataFolderName = "C:\\Users\\...\\...\\";
//--------------------------------------------------------------------------------------------------/
PROC SURVEY_MENU_SYSTEM_FF
PROC KEYER_NAME
if not $ in "AD","AE","ES","FB","JB","SB","ST","SW" then
errmsg ("Unknown person");
endif;
PROC SURVEY_NUMBER
//--------------------------------------------------------------------------------------------------/
if $ = 1 then
// 1) create new PFF file
setfile(pffFile,strip(pffFileName),create);
// 2) write out PFF file with data file based on keyer's name
filewrite(pffFile,"[Run Information]");
filewrite(pffFile,"Version=CSPro 5.0");
filewrite(pffFile,"AppType=Entry");
filewrite(pffFile,"[DataEntryInit]");
filewrite(pffFile,"Interactive=Ask");
filewrite(pffFile,"OperatorID=%s",KEYER_NAME);
filewrite(pffFile,"StartMode=add");
filewrite(pffFile,"FullScreen=No");
filewrite(pffFile,"[Files]");
filewrite(pffFile,"Application=..\\Entry\\GDC_Dossiers.ent");
dataFileName = maketext("%s.dat",KEYER_NAME);
filewrite(pffFile,"InputData=%s\\%s",strip(dataFolderName),strip(dataFileName));
// 3) close PFF file
close(pffFile);
// 4) create a copy of data file on a remote folder
//filecopy(maketext("%s\\%s",strip(dataFolderName),strip(dataFileName)),
// maketext("%s\\%s",strip(remoteDataFolderName),strip(dataFileName)));
// 5) create local backup of data file
filecopy(maketext("%s\\%s",strip(dataFolderName),strip(dataFileName)),
maketext("%s\\Backup\\%s_%d",strip(dataFolderName),strip(dataFileName),sysdate("DDMMYYYY")));
// 6) launch the PFF file
execpff(strip(pffFileName));
// 7) close the menu program
stop(1);
//--------------------------------------------------------------------------------------------------/