Port Data

Posted on 2003-03-12
Medium Priority
Last Modified: 2010-04-07
Hi, i am a newbie and i am hoping you guys can help.

I am running VB Prof 6.0 on Windows NT. I am using NTport to access the parallel port.

I can get the data in fine, convert it to decimal and have it appear as a single number in a text box. What i want to happen is have the data be saved in a string (?) format and output to a file as well as saved in a global variable.

The data comming in is a phone number from a dtmf decoder. So how can i save the 7 digit number together, save it in a global variable (for immidiate use) and output it to a text file.

Thanks for the help.
Question by:sam341
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8126207

If you have got the value, try this:

dim myValue as long

myValue = val(text1.text)

where Text1 is the textbox where you save the received data.
To save it to a file, just do it like this:

dim fn as long

fn = FreeFile
Open "C:\myFile.txt" For Output As #fn
Print #fn, myValue
close #fn

Hope this helps

Author Comment

ID: 8127722
Will this basically accumulate the incoming data and put it in the sting??

The data comes in 1 number at a time, and i need it saved after the seven bits enter.


Accepted Solution

marconovaro earned 300 total points
ID: 8127772

You can concatenate incoming data into a string:

myString = myString & myReceivedData

then, after you received seven numbers, you use the Val() function to get the number.

Expert Comment

ID: 8900191
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 9664571
Moderator, my recommended disposition is:

    Accept marconovaro's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question