|
-
May 24th, 2000, 10:31 PM
#1
Thread Starter
Addicted Member
Ok...right now I'm working as a temp at a very large advertising company, doing data entry. From the first day I got here, I started writing little programs that did a LOT of my work for me.
Well, one of my programs has become VERY useful to everyone here, and I've been wanting it to do a certain thing, but I put it off because it was a little too complicated.
Here is what my program does:
This advertising company owns billboards all over the country. The office I work at pretty much controls all the billboards in Central Florida. The company has decided to start putting photos of all boards on their website, so that potential advertisers can check out the statistics.
Each board has 4 picture files:
Large Closeup Shot
Thumbnail of Closeup Shot
Large Far Away Shot
Thumbnail of Large Far Away Shot
Every one in a while, we need to know which boards have panels, which boards are new, and which boards don't have all 4 pictures (the last thing also helps find misnamed files). My program does this beautifully.
When I first started with the program, to print the data, I just did this:
Printed all the items in the listbox to a file, and opened the file in notepad. The user could then tell notepad to print.
Of course...there are thousands of billboards, so printing them all like that was a waste of paper
Example:
124
654
5676
7777
8888
9999
blah...
So....I suck at math, but after playing around I finally got it just to do this instead:
124 654 5676 7777 8888 9999
10000 10002 10004
But I saw that that wasn't a very good way to do it, so I changed it to this:
124 8888 10004
654 9999
5676 10000
7777 10002
Which was GREAT. And everyone was happy.
Now...remember we have lots of panels. Here is an actual real real result of output:
Company: 020 List Created: May 22 / 11:06 Total: 574
Location: f:\020webpix\final upload pix
The following panels have images associated with them:
177 (4) 3113 (4) 23722 (4) 25313 (4) 25506 (4)
275 (4) 3114 (4) 23723 (4) 25314 (4) 25507 (4)
276 (4) 3119 (4) 24061 (4) 25315 (4) 25508 (4)
436 (4) 3120 (4) 24062 (4) 25317 (4) 25511 (4)
515 (4) 3123 (4) 24093 (4) 25318 (4) 25512 (4)
656 (4) 3124 (4) 24094 (4) 25319 (4) 25517 (4)
657 (4) 3127 (4) 25001 (4) 25320 (4) 25522 (4)
820 (4) 3128 (4) 25002 (4) 25321 (4) 25523 (4)
993 (4) 3129 (4) 25003 (4) 25322 (4) 25524 (4)
994 (4) 3130 (4) 25004 (4) 25323 (4) 25525 (4)
997 (4) 3131 (4) 25040 (4) 25324 (4) 25547 (4)
998 (4) 3132 (4) 25041 (4) 25325 (4) 25548 (4)
999 (4) 3133 (4) 25050 (4) 25326 (4) 25567 (4)
1001 (4) 3157 (4) 25051 (4) 25327 (4) 25568 (4)
1010 (4) 3166 (4) 25060 (4) 25328 (4) 25570 (4)
1035 (4) 3167 (4) 25061 (4) 25329 (4) 25571 (4)
1041 (4) 3275 (4) 25064 (4) 25331 (4) 25572 (4)
1191 (4) 3309 (4) 25065 (4) 25332 (4) 25574 (4)
1249 (4) 3310 (4) 25066 (4) 25333 (4) 25577 (4)
1256 (4) 3311 (4) 25067 (4) 25334 (4) 25578 (4)
1257 (4) 3312 (4) 25070 (4) 25335 (4) 25579 (4)
1264 (4) 3318 (4) 25071 (4) 25336 (4) 25580 (4)
1277 (4) 3335 (4) 25072 (4) 25337 (4) 25581 (4)
1278 (4) 3482 (4) 25073 (4) 25338 (4) 25582 (4)
1289 (4) 3483 (4) 25074 (4) 25339 (4) 25583 (4)
1306 (4) 3484 (4) 25075 (4) 25340 (4) 25584 (4)
1325 (4) 3485 (4) 25076 (4) 25341 (4) 25585 (4)
1328 (4) 3525 (4) 25077 (4) 25342 (4) 25586 (4)
1335 (4) 3526 (4) 25089 (4) 25343 (4) 25587 (4)
1336 (4) 3533 (4) 25090 (4) 25344 (4) 25588 (4)
1352 (4) 3537 (4) 25094 (4) 25345 (4) 25589 (4)
1399 (4) 3539 (4) 25095 (4) 25346 (4) 25590 (4)
1400 (4) 3546 (4) 25096 (4) 25347 (4) 25591 (4)
1475 (4) 3548 (4) 25098 (4) 25348 (4) 25592 (4)
1574 (4) 3613 (4) 25099 (4) 25349 (4) 25593 (4)
1649 (4) 4000 (4) 25138 (4) 25350 (4) 25602 (4)
1650 (4) 4003 (4) 25139 (4) 25351 (4) 25603 (4)
1653 (4) 4011 (4) 25151 (4) 25352 (4) 25604 (4)
1676 (4) 4012 (4) 25158 (4) 25353 (4) 25605 (4)
1678 (4) 4037 (4) 25161 (4) 25354 (4) 25606 (4)
1679 (4) 4050 (4) 25162 (4) 25355 (4) 25607 (4)
1680 (4) 4053 (4) 25163 (4) 25356 (4) 25620 (4)
1681 (4) 4055 (4) 25164 (4) 25369 (4) 25621 (4)
1682 (4) 4070 (4) 25165 (4) 25370 (4) 25622 (4)
1683 (4) 4088 (4) 25166 (4) 25373 (4) 25623 (4)
1685 (4) 4103 (4) 25167 (4) 25374 (4) 25624 (4)
1687 (4) 4104 (4) 25170 (4) 25379 (4) 30099 (4)
1688 (4) 4115 (4) 25178 (4) 25380 (4) 32501 (4)
1689 (4) 4116 (4) 25179 (4) 25381 (4) 32502 (4)
1695 (4) 4131 (4) 25182 (4) 25382 (4) 32741 (4)
1696 (4) 4132 (4) 25183 (4) 25383 (4) 32742 (4)
1738 (4) 4223 (4) 25184 (4) 25384 (4) 32743 (4)
1739 (4) 4233 (4) 25185 (4) 25385 (4) 33171 (4)
My program works fine....but I noticed something, and didn't think anyone would care...but today I was asked if I could change it (damnit!).
When that list is printed out, it prints downwards, like it's supposed to, but the problem is it keeps going down pages, so if you want to follow the numbers, you have to go down one column, to the same column on the next page, and so on. See what I'm saying? We want it all on the same, so that instead of this:
1 11
2 12
3 13
4 14
5 15
<page break here>
6 16
7 17
8 18
9 19
10 20
we have this:
1 6
2 7
3 8
4 9
5 10
<page break here>
11 16
12 17
13 18
14 19
15 20
Suggestions?
-
May 24th, 2000, 10:44 PM
#2
Thread Starter
Addicted Member
Here is the code that does all the sorting, just FYI.
Also note that I'm using Visual Basic 4.0 to do this at work, not VB6.
Code:
Spacer$ = " "
Open "c:\temp.txt" For Output As #1
Print #1, "Company: " & frmMain.txtCompanyNum.Text & vbTab & "List Created: " & lblDoneDate.Caption & vbTab & "Total: " & DonePanels.ListCount
Print #1, "Location: " & File1.Path
Print #1, "The following panels have images associated with them:"
rows = Int(DonePanels.ListCount / 5)
For x = 1 To 5
frmMain.SavePan(x).Clear
Next x
For y = 1 To 5
For x = 0 To rows
frmMain.SavePan(y).AddItem DonePanels.List(0)
DonePanels.RemoveItem (0)
Next x
Next y
For y = 1 To 5
For x = 0 To rows
If Not frmMain.SavePan(y).List(x) = "" Then frmMain.DonePanels.AddItem frmMain.SavePan(y).List(x)
Next x
Next y
For x = 0 To rows
Col1 = "" & frmMain.SavePan(1).List(x) & String(9 - Len(frmMain.SavePan(1).List(x)), " ") & ""
Col2 = "" & frmMain.SavePan(2).List(x) & String(9 - Len(frmMain.SavePan(2).List(x)), " ") & ""
Col3 = "" & frmMain.SavePan(3).List(x) & String(9 - Len(frmMain.SavePan(3).List(x)), " ") & ""
Col4 = "" & frmMain.SavePan(4).List(x) & String(9 - Len(frmMain.SavePan(4).List(x)), " ") & ""
Col5 = "" & frmMain.SavePan(5).List(x) & String(9 - Len(frmMain.SavePan(5).List(x)), " ") & ""
Print #1, Col1 & Spacer$ & Col2 & Spacer$ & Col3 & Spacer$ & Col4 & Spacer$ & Col5
Next x
Close #1
ret = Shell("notepad c:\temp.txt", vbMaximizedFocus)
Kill "c:\temp.txt"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|