Qbasicnews.com
Write a program for file "changing" - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html)
+--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html)
+--- Thread: Write a program for file "changing" (/thread-3809.html)



Write a program for file "changing" - Wizard Genius - 04-24-2004

I don't know how to make the subject just right, but here's the challenge:

Make a program in VBDOS or maybe just QBasic (use a GUI or TUI, not just command-line "type a filename:" stuff) that:

-Splits Huge files to smaller files
-Takes a split file and makes it back into one
-Packs many files together into one
-Unpacks one file back to multiple ones (from above)
-Opens a binary file and converts it to text (such as XX3402, used in SWAG Pascal - do a google search and download it, it comes with Pascal Source)
-Take a text file and convert it back to binary (from above)

Of course, all operations will need to use binary mode so one can pack/unpack or split/unsplit Binary files (EXE's, ZIP's, etc). Like I said, it should be in VBDOS or some other TUI or even better a GUI (but only if it isn't flashy). Make it fast and easy to use (not command-line). Send it to qbspot@zwallet.com for rating.


Write a program for file "changing" - Plasma - 04-24-2004

Get me a beer while you're at it.


Write a program for file "changing" - Mango - 04-24-2004

Quote:Get me a beer while you're at it.

Get me one while you're at it, and I'll send you WinZip + UUencode to do what you need...


Well, I don't really need it... - Wizard Genius - 04-28-2004

I just want to see what people come up with. You see, I can never make code for binary files work. I can make other peoples code work, but if I try to duplicate their code with even slight changes, it doesn't work. So I'm wondering what I'm missing, why other peoples code works, but my version of their code doesn't, why the heck this won't work:

Code:
do
            i = i + 1
            open "C:\binfile.bin" for binary as #1
              open "C:\binfile.bin" for binary as #2
              get #1, i, inbit$
              put #2, i, inbit$
          loop until eof(1)
          close #2
          close #1

I wondered why the heck that doesn't work. Any suggestions?


Write a program for file "changing" - Anonymous - 04-28-2004

me too :o

my ??cryptor works on anything but exe!! the files compare the exact same what gives?? cmon geniuses Tongue


Write a program for file "changing" - CGI Joe - 04-28-2004

It does work, it does exactly what you told it to do Wink

Maybe you mean this though?
Code:
open "C:\binfile.bin" for binary as #1
open "C:\binfile2.bin" for binary as #2

dim inbyte as string * 1

do
    get #1, , inbyte
    put #2, , inbyte
loop until eof(1)
close