Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help setting an array

Status
Not open for further replies.

txgeekgirl1

Programmer
Sep 10, 2009
85
US
Hi everyone - I know this sounds goofy as all get out, but the only arrays I have EVER built in FoxPro are for SCX window pick lists.

I have a calculation where I need an array that is Number of minutes long by number of clients wide.

Group A Met for 810 minutes - every client gets a portion of seconds in that 1 min window. In my example below for min 6, A & B each get 30 sec of that min. In min 7 they each get 20 sec. HELP!!! I need help setting up the array.

1 Client A
2 Client A
3 Client A
4 Client A
5 Client A
6 Client A Client B
7 Client A Client B Client C
8 Client A Client B Client C
9 Client A Client B Client C
10 Client A Client B Client C
11 Client A Client B Client C
12 Client A Client B Client C
13 Client A Client C
14 Client A Client C
15 Client A Client C
16 Client A Client C
17 Client A Client C
through 810
 
Why do you want to use an array for this? What do you need to do with it?

Consider using a cursor (a temporary table) instead.

Tamar
 
I was thinking about that - we use cursors all the time.

I guess maybe temp tables for time in to time out and loops based on minutes.

Government Obamacare crap. Instead of splitting a group providers time by the number of clients seen, you have to now do it by the minute. So if client C leaves the group to go pee, they don't get counted for the 4 minutes they were gone and you can't bill it.
 
I think what you're looking for is a way to track the time that a provider spends with each patient, where for a single visit, that time can be divided up into several chunks. I'll assume you already have tables for patient and provider, and that each has a primary key field. (I'll use PatientID and ProviderID for simplicity.)

So you probably want something like this:

ChunkID -- I wouldn't really call it this, but I'm not sure of the right name. The table should have a PK.
PatientID
ProviderID
Date
TimeIn
TimeOut

Since this is the old FoxPro forum, I'm assuming pre-VFP. If it's VFP, use two datetime fields for In and Out.

Once you have this data, you can do a fair amount with queries (though not as much in FP2.x as you could in VFP9), and whatever else you need with SCAN.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top