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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tell if something is available

Status
Not open for further replies.

fergmj

Programmer
Feb 21, 2001
276
US
Hello all -

I have a program that allows the user to select a start time, a stop time, a start date and a stop date in the following formats:

startdate = 3/1/01
stopdate = 3/1/01
starttime = 1:45:01 PM
stoptime = 3:45:01 PM

When the user makes their selections all of the above variables will have a variable similar to above.

I have 4 DSS recievers that are connected to computers running a server program. The server program capture the closed caption text from the video off of the DSS receivers.

I need to be able to take the user information and put it into a format (not a database) that will allow me to find a receiver is free at a certain time.

For instance (using the declarations above)...I need to look for the first available receiver (out of four) that would be free to record from 1:45:01 PM to 3:45:01 PM on 3/01/01.

Then if someone else asked to record a different channel but at the SAME DAYS AND TIMES, it would find the NEXT available receiver open. If none, it returns an error.

I have looked into arrays and structures but my knowledge of C++ is still a bit rusty and I feel as if I am spinning my wheels.

Any help would be great. Thanks!

Mindy
 
Try using 4 boolean variables. A bool variable returns a true/false condition.

Set them up similiar to this

bool isfree_DSS1
bool isfree_DSS2
etc.

When the user places his data set the isfree_DSS? to false.
In your program, search the isfree variables to find if the receivers are free.

When the recording time ends, set the variables to true again.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top