User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 391,548 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,520 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Views: 20543 | Replies: 4
Reply
Join Date: Jan 2006
Posts: 16
Reputation: Katrix36 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Katrix36 Katrix36 is offline Offline
Newbie Poster

Question Convert binary into text/text into binary

  #1  
Apr 24th, 2006
Hey all,

Would anyone be able to help me out with some code to convert text into binary / binary into text?

Your help would be much appriated.

Katrix36
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Posts: 12
Reputation: nvanevski is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
nvanevski nvanevski is offline Offline
Newbie Poster

Re: Convert binary into text/text into binary

  #2  
May 12th, 2006
It might seem strange to you, but text files are binary, too. It's the application that treats them differently. For example, if you change the extension from .txt to .bin, the application will not handle it the same.

If you are more precise in what you want to do, we might be able to help you better.
Reply With Quote  
Join Date: Jan 2006
Posts: 16
Reputation: Katrix36 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Katrix36 Katrix36 is offline Offline
Newbie Poster

Re: Convert binary into text/text into binary

  #3  
May 13th, 2006
Originally Posted by nvanevski
It might seem strange to you, but text files are binary, too. It's the application that treats them differently. For example, if you change the extension from .txt to .bin, the application will not handle it the same.

If you are more precise in what you want to do, we might be able to help you better.


To be more precise, I'm wanting a program that I can type some text into a textbox or memo, and then it displays that text in binary in another textbox/memo.
Reply With Quote  
Join Date: Dec 2004
Posts: 12
Reputation: nvanevski is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
nvanevski nvanevski is offline Offline
Newbie Poster

Re: Convert binary into text/text into binary

  #4  
May 13th, 2006
That should be pretty straightforward. On a click of a button, take the Text property into a String variable, then with one "for" loop walk the string, take every character, get the integer presentation using the Asc function, and display it in the other memo.
Reply With Quote  
Join Date: Jan 2006
Posts: 16
Reputation: Katrix36 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Katrix36 Katrix36 is offline Offline
Newbie Poster

Re: Convert binary into text/text into binary

  #5  
May 13th, 2006
thank you for youe help
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Pascal and Delphi Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 9:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC