Menu Application Without a Data File(.dat)

Discussions about CSEntry
Post Reply
munirmdee1
Posts: 75
Joined: August 17th, 2015, 9:32 am
Location: Dar es Salaam, Tanzania

Menu Application Without a Data File(.dat)

Post by munirmdee1 »

Hi everyone,
I'm stack here, I have Menu application, which I use to run another application according to what a user enters in Menu application choice the user make from the Menu. Now assume you Menu application like this; Menu.dcf,Menu.ent,Menu.app,menu.pff,Menu.fmf and other files. The Fileds or items in application are; Cluster ID and Cluster Name, the ID part contains only one item which is Cluster ID.

I need to use this application in such a way that when a user a a Cluster ID, then the manu with options like; Begin New Entry, Edit Existing, Quit e.t.c. Actually all those are not the problem, the problem comes when I enter a Cluster ID like 345, another application should open to allow the user to enter some data, when the user finishes entering information, that new application can close and get back to menu, when the user tries to enter the same Cluster ID, the application says, the case with the same ID already exists, this is done because the user entered the cluster id when started entering new information. My concern here I want the user to be able to enter the same cluster again, but second time if for editing.

The user can not until the user closes the application and reopen it again, I want the user to be able to enter information after finish, then edit them right away.

How do I do that? Help please, I opened Menu.pff in notepad and deleted the line "InputData=.\Menu.dat" so that it should not save the Cluster ID into Menu.dat file, but still it create a temporary file and save Cluster ID while at Run Time, untill you close the application and reopen again the temporary file goes away.

Can anyone help me on that?
Thanks in advance, hope to hear from you guys..
Munir Mdee
Software Programmer
National Bureau of Statistic (NBS)
Jakaya Kikwete Road,
P.O.Box 2683,
Dodoma,TANZANIA
Mob: +255 755 740090
Email: munir.mdee@nbs.go.tz
munirmdee@gmail.com
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Menu Application Without a Data File(.dat)

Post by josh »

When you right out the .pff file to launch the data entry application if you know that the cluster id is an existing one you can write StartMode=Modify to have the data file open the existing case in modify mode rather than trying to open a new case with the same cluster id.

You will need to write out the case ids on the same line after Modify so if your case id's are province, district and cluster then you would do something like:

filewrite(pffFile, "StartMode=Modify;%d%02d%04d", PROVINCE, DISTRICT, CLUSTER);

so if you have province=1, district=22 and cluster=4444 then your code would write out:

StartMode=Modify;1224444

which would launch the application in modify mode and open case 1224444.

The tricky part here is knowing that this is an existing case. I usually add my main data entry dictionary as an external dictionary to my menu application and then use loadcase on it to check if the case exists.
Post Reply