A complicated thing?

From: Geir Baardsen (geir_baardsen_at_hotmail.com)
Date: 03/28/05


Date: 28 Mar 2005 05:11:41 -0800

Hi!
Here's a really complicated thing (for me anyway):

I've made a scheduler.
 There is Combo (cboPersons), a radiogroup (MyWeekNumbers) and a
stringgrid (grSch)

When user chooses person and week, the stringgrid will load a
txt-file,
 showing the whole week (mon - sat) in the grSch.

Here's some of the code in the MyWeekNumbers.OnChange:

 var
  MainDir.DirPerson,HisFile,FileRes:String;
   begin
    MainDir := 'C:\Agenda\' + FormatDateTime('yyyy',now) + '\';
    DirPerson := MainDir + cboPerson.Text + '\' +
MyWeekNumbers.Caption + '\';
    HisFile := MainDir + DirPerson + cboPerson.Text + '.dat';
    FileRes := HisFile;

    Case MyWeekNumbers of
    0:begin
     ...etc....

 It all works just well.

However, as a most excellent service, I'd like to have the application
load
 the text file for the week we're in - (I'll of course check if
FileExistst(FileRes)) -
  into the grSch in the 'OnCreate'-event.

   I think I have to check for which week we're in and make that a
part of
   the 'DirPerson'-variable, not so?

  Then I'd like to set the focus in the radiougroup on the actual
weeknumber we're in.

  I guess I've to cycle through the radiogroup, but have failed so
far.

   If I could obtain this second, then the rest would be quite easy,
as speaking
    of altering the 'DirPerson'-variable, no?

How am I to accomplish this?

Happy programming and remember to do loosen up shoulders and neck
every hour!