'' The below code is basic code it can be run in Q basic as a dos command.exe
" or from a Visual Basic command button click
'''Copy and paste it into a text file to view it properly
'' in Visual Basic with the use of text boxes and variables the data can be sent to the files from user input
''' but for now it is a simple display of working with text files
''First create two text files and put a column,list of numbers in them say 10 random numbers in each file like this
10
2
45
35
etc...
name them .... File1.txt and File2.txt
save them in the folder that the program is being created in or in the C: root if in the C\: root
the "C:\File1.txt" path must be fully named
''(paste the below code into a command click operation )
Close '''Precaution close all open files
Open "File1.txt" for input as #1 ''Opens the existing file for reading
Open "File2.txt" for input as #2 ''Opens the existing file for reading
Cpen "File3.txt" for output as #3 ''Opens the existing file for writing,
''Output will create the file if it does not exist will overwrite it if it does exist
do '''start of loop
' below code Places data from text file in the variables in temporary RAM memory as variable copya and copyb
Input #1, copya ''''''copy info from first line of File1
Input #2, copyb '''copy info first line of File2
copyc= copya+copyb ''add 2 variables create third variable
write #3, copyc ''''writes the variable data to the first line "file3.txt
Loop until eof(1)=true or eof(2)=true ''numbers are taken from the text files one row at a time
" until the end of file is reached then the loop is exited
Close '''close all open files
End
My Page has many quick explainations of basic commands
Feel free to contribute Or enlighten me with code examples that are not on my page
I am particularly interested in learning hardware periph