Computing.Net > Forums > Programming > VB-How to make two files interact?

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VB-How to make two files interact?

Reply to Message Icon

Original Message
Name: Langside
Date: April 21, 2004 at 06:43:40 Pacific
Subject: VB-How to make two files interact?
OS: xp pro
CPU/Ram: 700/512
Comment:

Hi there I have to find out how to make two files interact. What I am trying to do is make a file with 10 sessions, each session consisting of 20 places like such:
4
20
13
14
18
3
7
10
20
19

The idea is that each session represents a morning and afternoon totalling five days. So in the list I just made Monday afternoon and Friday morning are full because there is only 20 places. The idea is to make a program where people can choose 3 places out of the 10 sessions and if all 3 places are not available then they go on a waiting list. They cannot have 1 or 2 places. All three must be available. The waiting list would then have to interact with the sessions list at the start of the program (or when a command button is clicked) to see if any places are available after some places have been altered. I have not been instructed to take people off the list so I am guessing that I would just go into the the file manually and remove places to see if the waiting list updates.
I can't get my head around the idea of an if statement checking the places either because it would take too many statements to cover all the possibilites. I am using check boxes for each of the 10 places. Every two check boxes are placed in a frame so that they each make one day.
I hope you can understand what I just asked! Thanks for any help :-)


Report Offensive Message For Removal


Response Number 1
Name: wizard-fred
Date: April 21, 2004 at 09:42:53 Pacific
Reply: (edit)

I think you may have misdefined your problem.

You have 10 sessions each with 20 spaces.
A participant has to register for 3 sessions.

The maximum number of partipants is 66.

Participant array
n by 3
If the participant has 3 available sessions he is registered, otherwise waiting list.
Problem is filling the sessions, if there is dropouts, after the sessions start.

Session Array
10 by 20

Actually the problem is "stupid". The content of the sessions are assumed equal. But a last session for an early participant could be the first for another. Unless the is no interaction between participants, like using computers in a lab. Also, rescheduling if there are dropouts or changes, assume that the people would be waiting around to be called. What if their initial choices have passed?

You only need 10 check boxes, no need to group them by day.

You don't need that many if's, just loop through the choices and sessions.

There should not be any conflicts for the first 20, wait listing is the problem, because the early sessions would more likely be filled first.

It may be easier, if you allowed for the entry of alternate sessions or real time entry that would only allow signing for available empty sessions.

It would be better to program delete and change.


Report Offensive Follow Up For Removal

Response Number 2
Name: Langside
Date: April 21, 2004 at 10:59:28 Pacific
Reply: (edit)

Hi wizard-fred. Thanks for replying. I'm not sure I understand your reply. I think if I made a drop down list of people already registered that had an option of removing them then it would make more sense because after removal then the waiting list could be looked at and if any client had three choices that were all available then they could be moved to the registered list and the three places incremented. I thought the problem was simple regarding what the program must achieve. The only problem I have is that I'm a complete newbie lol. Could you give me an idea of how to check the 10 sessions for 3 places? How would I loop the check box choices?
Thanks again for replying :-)


Report Offensive Follow Up For Removal

Response Number 3
Name: wizard-fred
Date: April 22, 2004 at 09:56:48 Pacific
Reply: (edit)

Assuming record of registrant
registrant_id
session(1)
session(2)
session(3)
status

Assuming session/participant array
Session(10, 20)
session(N, P) initialize P = 0 else store participant no

rem check for availability
avail$ = "NNN"
for n = 1 to 3
N = session(n)
for m = 1 to 20
if (session(N, m) = 0) then
mid$(avail$,n,1) = "Y"
end if
next m
next n

IF (avail$ = "YYY") then goto register

Variations of this to add, delete, change.

I still program in BASIC (usually PowerBasic).


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software