Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21271

Records missing from output by sub

$
0
0
The Routine used to copy the data is:
Code:

Dim Records As Integer
Dim x As Integer
Dim InputHandle As Integer
Dim OutputHandle As Integer
Dim FileData As String

FileData = Space$(256)


Open "a:\ltmed.txt" For Binary As #1

Open "C:\Test\Patient2.txt" For Output As #2
Records = LOF(1) / 256
For x = 0 To Records - 1
    Get #1, , FileData
    Print #2, Mid$(FileData, 1, 80)
Next

Close #1
Close #2

The input file AKA ltmed.txt is:
Quote:

10-26-06 P Rx Tel: 1 @ 01-17-02 P PHARMACY PHONE: 1 @ 01-17-02 C COMPLIANCE: 1 @ 01-17-02 G ALLERGIES: CELEBREX- RASH 1 @ 01-17-02 A REACTIONS: 1 @ 02-11-04 MOXIFLOXACIN (AVELOX) 400MG-1 QD-#10-1 Refill i 3 A 041.9 04-15-05 02-09-04 ERYTHROMYCIN 333MG-1 TID W/Food-#30-1 Refill 1 A 041.9 03-01-06 ACYCLOVIR OINTMENT (ZOVIRAX) 5%-#1 Tube-2 Refil 1 C 053.9 06-14-04 D ACYCLOVIR 400MG-1 TID-#90-2 Refills 1 C 054.9 06-14-04 D RISEDRONATE (ACTONEL) 35MG-1 Per Week-#4-2 Refi 1 G 733.01 10-25-05 06-28-02 D PREMPRO (ESTROGEN/PROGESTIN) 2.5/0.625MG-1 Dail 1 G 733.01 10-26-06 > CETIRIZINE (ZYRTEC) 10MG-1 QD-#30-2 Refills 1 H 995.3 03-01-06 NASONEX (MOMETASONE) 50MCG-Once QD-Fill for 3 M 1 H 995.3 02-09-04 D NASONEX /TROVENT/ RHINOCORT 1 H 995.3 12-30-03 D DIAZEPAM 5MG-1 QD at Bedtime-#30-2 Refills 1 J 307.41 01-17-03 > ZOLPIDEM (AMBIEN) 10MG-1 QD at Bedtime-#30-2 Re 3 J 307.41 10-26-06 11-15-02 D ZALEPLON (SONATA) 10MG-1 QD at Bedtime-#30-2 Re 1 J 307.41 08-29-05 MECLIZINE 12.5MG-As Needed-#40-1 Refill 1 L 780.4 02-11-04 D CORTISPORIN OPHTHALMIC DROPS-3 Drops 1 QID-#1-1 1 L 372.30 11-15-02 > ATORVASTATIN (LIPITOR) 20MG-QD-#30-2 Refills 1 M 429.2 10-26-06 06-28-02 D SIMVASTATIN (ZOCOR) 20MG-1 Daily at Bedtime-#30 2 M 429.2 08-13-02 03-19-02 D PRAVASTATIN (PRAVACHOL) 20MG-1 at Bedtime-#30- 1 M 429.2 06-17-02 02-09-04 VICODIN TUSS 8 OZ-1 tsp./4-6 hrs-#1-1 Refill 2 N 786.2 04-15-05 12-22-04 FLUCONAZOLE (DIFLUCAN) 150MG-Once-#1-2 Refills 1 P 616.10 07-30-03 CONJUGATED ESTROGEN 0.625MG/GR-One 42.5gr Tube- 2 P 627.3 10-14-03 01-17-02 CLORTRIMAZOLE (LOTRISONE CREAM) 1%-2 Times/Day- 1 Q 692.9 01-17-02 ACYCLOVIR OINTMENT (ZOVIRAX) 5%-#1 Tube-2 Refil 2 Q 053.9 06-14-04 12-30-03 D ROFECOXIB (VIOXX) 25MG-1 QD-#30-2 Refills 1 R 716.90 07-30-03 FLURBIPROFEN 100MG-1 BID-#60-2 Refills 1 R 716.90
as you see that is all on one line..

The output file aka patient2.txt is:

Quote:

10-26-06 P Rx Tel: 1 @
01-17-02 G ALLERGIES: CELEBREX- RASH 1 @
02-09-04 ERYTHROMYCIN 333MG-1 TID W/Food-#30-1 Refill 1 A 041.9
06-14-04 D RISEDRONATE (ACTONEL) 35MG-1 Per Week-#4-2 Refi 1 G 733.01 10-25-05
03-01-06 NASONEX (MOMETASONE) 50MCG-Once QD-Fill for 3 M 1 H 995.3
01-17-03 > ZOLPIDEM (AMBIEN) 10MG-1 QD at Bedtime-#30-2 Re 3 J 307.41 10-26-06
02-11-04 D CORTISPORIN OPHTHALMIC DROPS-3 Drops 1 QID-#1-1 1 L 372.30
03-19-02 D PRAVASTATIN (PRAVACHOL) 20MG-1 at Bedtime-#30- 1 M 429.2 06-17-02
07-30-03 CONJUGATED ESTROGEN 0.625MG/GR-One 42.5gr Tube- 2 P 627.3 10-14-03
12-30-03 D ROFECOXIB (VIOXX) 25MG-1 QD-#30-2 Refills 1 R 716.90
As you can see the formmating is fine but there are many records missing. What must be changed in the routine to get it to read all the records? i have been trying different numbers for the filedata = Space$(#) line and that changes some things but not what i need. Please assist -_-

Viewing all articles
Browse latest Browse all 21271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>