473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to enter data by keyboard and saved to a text file and load it to another progra

I am going from gwbasic to vb 6. I want to enter data from one program to be read from a second program.
The data now looks like this

A line
122,43/34/49,23,97,69,56,45,89,872,3444,1,866666,643434,
87,88777,333222,6555,223,65542,755,4,34,34,276,55, 988,456545,7664,12,54,99

Another line

123,413/35/09,27,7,669,46,75,09,72,9744,1,861119,6466114,
67,89857,54382,65,22,62,76545,74,36,64,266,55,988, 456545,7664,12,54,99

I could also use a list of all terms used in the programing of v basic 6 and .net
Apr 22 '11 #1
7 4179
Guido Geurs
767 Expert 512MB
Please can you give more specifications?
- What do you want to do in VB6 with the data?
- is the original file a x.TXT file (ASCII)?
- What do you want as output : x.TXT (ASCII)?
Is it possible to attach in Bytes a demo file of the data (input and output) ?
A screencapture of the GWbasic program?
Apr 22 '11 #2
I want to input it from the keyboard to add the date line to the file. It will look just like the line listed in my question. This is for the first program. The second program will input all the lines store them in an array do some fuzzy math (lol) and output the data to another file.
Apr 22 '11 #3
Guido Geurs
767 Expert 512MB
Questions:
Q1 - do you want to input the data "line by line" or a hole text (multiple lines) at once?
Q2 - must the data in the array be split on each comma ?
Q3 - has each line 31 data's ?

Attached is a demo of the programs
Apr 23 '11 #4
http://humoror.ru Буратино несем в ожоговый.2423... Сборник анекдотов
Apr 24 '11 #5
Yes it will have 31 + data's in the input. they will be pulled out as 31 indepentent values. I think I got it but would liketo learn more way to do it.
Apr 26 '11 #6
Guido Geurs
767 Expert 512MB
In my previous mail I have attached an example with the code for saving text to a file =
Expand|Select|Wrap|Line Numbers
  1. Private Sub ComAddToFile_Click()
  2. Dim OUTPUTFN As Integer '§ filenumber
  3.    OUTPUTFN = FreeFile '§ asign a free number to the variable
  4.    On Error GoTo ErrWriting '§ jump out sub  if there is an error
  5.    Open App.Path & "\Data.txt" For Append As #OUTPUTFN '§ openthe file "data.txt" in the home folder of the program
  6.       Write #OUTPUTFN, Text1.Text '§ append the text from Text1
  7.    Close #OUTPUTFN '§ close the file
  8. Exit Sub
  9. ErrWriting:
  10.    Close #OUTPUTFN '§ close the file
  11.    MsgBox ("There is an error writing the Data file !") '§ show a message
  12. End Sub
This is how to open the datafile and put the data in an array=
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Dim FILEIN As Integer '§ variable for filenumber
  3. Dim INPUTDATA As String '§ variable for holding inputdata
  4.    ReDim ARRAYDATA(0)
  5.    FILEIN = FreeFile '§ variable = a free number
  6.    On Error GoTo Error_Loading '§ exit sub if error loading file
  7.    Open App.Path & "\data.txt " For Input As #FILEIN '§ open file with data
  8.       Do While Not EOF(FILEIN) '§ loop through the file until "end of file"
  9.          ReDim Preserve ARRAYDATA(UBound(ARRAYDATA) + 1) '§ add 1 line to the array
  10.          Input #FILEIN, INPUTDATA '§ read next line in the file
  11.          ARRAYDATA(UBound(ARRAYDATA)) = INPUTDATA '§ enter data in the array
  12.       Loop
  13.    Close #FILEIN '§ close the file
  14. Exit Sub
  15. Error_Loading:
  16.    Close #FILEIN '§ close the file
  17.    MsgBox ("Error loading !") '§ show a message
  18. End Sub
PS: Attached is the demo
Apr 27 '11 #7
ya its working thank you
May 15 '12 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: adrian GREEMAN | last post by:
When I try to import a text file with new data for an existing table I get the error "1148 - the used command is not allowed with this MySQL version." I have tried with both PHPMyAdmin2.3 and...
2
by: sympatico | last post by:
hi, pls help me slove this problem. i am a newbie in using asp.net and SQL server 2000 and my problem for now is to pass data to a textfile and i have fail to do so. the way i did it was i used...
2
by: Pramod Kumar | last post by:
Dear All, I want to read data from a text file using Stream Reader. Please tell me the .DLL file to be added for the same. Regards, Pramod
13
by: DH | last post by:
Hi, I'm trying to strip the html and other useless junk from a html page.. Id like to create something like an automated text editor, where it takes the keywords from a txt file and removes them...
2
by: Praveen_db2 | last post by:
Hi all Db2 8.1.3 windows Is there any way to write data into a text file using a stored procedure? The way we return a cursor output to the calling application, can we return data in a text...
2
by: monkeyinquisition | last post by:
Hi All, I'm trying to read data from a text file into an array. The text file (a test) looks like this: 1 2 3 4 5 6 7 8
2
by: Naha | last post by:
Hi Guys, Does anyone know how to display data from a text file onto a webpage? So far I have opened and read the data in the text file and printed it out on command line, but I am having...
7
by: jetaw03 | last post by:
guys, can you help me to get data from a text file and putting it in an excel file? my programming language is visual basic 6.0 here is a sample data from the text file: ...
1
by: okd | last post by:
I am transfering data from a text file which is in uniccode format to a table . I am getting below error. SQLState = 22005, NativeError = 0 Error = Invalid character value for cast specification...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.