#### Archived

This topic is now archived and is closed to further replies.

# OK, i'm back, and I need some help, but this is a better explaination :)

This topic is 5801 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

First I''ll give you a litle background info. I took 3 years of C++ classes in high-school, but that was a while ago. Therefore, I will most likeley UNDERSTAND anything that you could post here, but I might not remember exactly how to do that in a syntax sence. I have worked with Classes, structs, matricies, stacks, queues, bubble, quick, and linear sort, and a ton of other crap that I don''t remember. 3 years is a while, but it seems like even longer since i''ve used this stuff. So now, on to my question, I feel so stupid. . . I need to write a program that runs in windows and punches keystrokes into a terminal emulation program. All I want it to do is look at the screen, and based on what the screen says, it punches in some keystrokes. OK, how about a little more detail. This is for a junkyard of cars/parts. Each car has a ''stock number'' associated with the whole car and all of its parts. I have a data file with about 1600 pages and 40 stock numbersper page of cars that need to be ''crushed'' (removed from the inventory) by using our inventory program. The crush utility only does one car at a time, so instead of going through them one by one and getting carpoul tunnel, I figured I could write a program to do it. This proved to be hard since the only C++ i had ever done was in linux, and don''t really know where to start with windows. But heres some specs of what the program needs to do, and what areas I need help with. - Open a window and ask which Data file the user would like to crush cars from(need help with opening a window) - input my predefined username and password into the terminal, and then press the keystrokes that get to the crush vehicle utility(need some help with sending keystrokes to the terminal) -while the program is running, it will look at the data file, and double check to make sure the car needs to be crushed, and there are 2 parameters on which it will not: a) if the car has a ''location#'' in the yard, b) if the ''date entered field is less than 3 months old. here is a sample line from the data file: Year Stock# Location null null date entered 1987 C4707 TY07B23 0.00 0.00 01/09/97 the file also has some non-essential lines, such as car makes and models, which I don''t care about. So i check every line to make sure it starts with a 19 or a 20 (the year will always start with a 19 or 20) I know how to do that. I was running into a problem with how to check the date because there are multiple dates on each line, I only showed this one for our purposes. The location will ALWAYS start with an FY, TY, or DY, so that was easy. heres the part i need help. If in fact that stock# has a location, or was entered in the last 3 months, i need it to stop looking at that line and go to the next one, not sure how to do that. (Silly of me, i know) - Once it has the Stock# in the buffer, it will type that into the terminal, and ALWAYS hit a "Y" + "Y" + "N" unless the location name is "SCRAP" If the location is "SCRAP", it should only type "Y" + "Y". (again, I know how to check what is being buffered, but I don''t know how to make the program type keystrokes for me). - on some cars, a secondary menu will come up. I need to know how to check for that, and then if that happens, all i need to do it hit two(2) "Enter"''s or return carriages. it then goes back to buisness as usuall. also, I need to think of a better way to parse the file. I was using someting like this. assume all variables have been declared.  while ( !in.eof ) { in.getline(BUFFER, 1023); for (int i = 0; i < sizeof(BUFFER); i++)  note: i know what your thinking. cin.getline right? in is my inFile variable if theres a better way, any help on that would be appreciated as well. I know this is a lot, but any help that anyone can offer would be great. My email is bassman@swirvemail.com, and my ICQ is 97981561. again, any and all help will be well recieved (as well as criticism about my spelling and bad programming habits)but if anyone can help it would be awesome, this is for work, and I am on sort of a time limit, so. . . thanks. -Zack-

##### Share on other sites
> - input my predefined username and password into the terminal, and then press the keystrokes that get to the crush vehicle utility(need some help with sending keystrokes to the terminal)...

Doesn''t your terminal program give you the functionality you desire? If it does, what about it is lacking? (Will it only allow you to crush one car at a time, but you want to crush 1000''s at a time?)

Perhaps a better way would be to not use your terminal program at all, but figure out how to tie a window''s program into the database and do everything from there?

Good luck.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632993
• Total Posts
3009763
• ### Who's Online (See full list)

There are no registered users currently online

×