Reading data from previous month?

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Reading data from previous month?

Post by Anne »

Today's callenge: I already have an application for collecting prices weekly, and to ensure good quality data, I want to check whether prices are in the range +- x% compared to last week.

To do this, I made a copy of the dictionary and a startup-application. In the startup-appication I just copied the data file and then called the main application using both dictionaries: The dictionary-copy to open the copied data file, and the original dictionary to open the actual data file. It is ugly, but it works.

But now I'm going to start using CSweb, and my first thought was "great" I can copy the data file in the menu application - a slightly less ugly way. But to my big disapointment, I need to specify the dictionary of the data file in the sync function, ad hence make it a part of the menu application - and of course, this locks the data file so that I can't copy it.

How do I solve this the best way?

(An obvious and ugly solution could be to have the menu application and the main application, and then make an "inbetween" application to copy the datafile, but this I don't like)

Anne
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Reading data from previous month?

Post by josh »

You can call close() on the dictionary (e.g. close(MY_DICT)) to close the data file, copy the data file and then reopen it again with setfile().
Post Reply