I need to search a string opened from a text file to see if an inputted number matches a value with the file.
so;
Code:inputnum as integer, numfound as boolean inputnum = val(txtinput.text) open alreadyusednums.txt for input as #9 do until numfound = true 'what do i do here 'once found, numfound = true loop close #9
alreadyusednums.txt would look like this
Code:154 3545 25 645 234 7777 223 7677 2 3443 334 4535
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 3 of 3
Thread
-
-
Assuming you are reading the file to find numbers matching "inputnum", then the reading code should be like:
Dim s as string
Open alreadyusednums.txt for input as #9
Do Until numfound = True
Line Input #9, s
if isnumeric(s) Then
if val(s) = inputnum then numfound = true
endif
loop
The If Isnumeric(s) line is there in case your .txt file contains an empty line, which would cause val(s) to generate a type mismatch error.The more I learn, the more I come to realize how little it is I know. -
I actually found a way to do it after I posted, came back here in about 30min and you had found a better way!
that was fast
Similar Threads
-
Subtitle Creator error: Input string not in correct format
By kpic in forum SubtitleReplies: 6Last Post: 31st May 2013, 04:17 -
Need help to find the perfect encoding string for ffmpeg
By iwiiiiiiiiii in forum LinuxReplies: 1Last Post: 14th Oct 2011, 15:28 -
How do I string videos together?
By Glenvern in forum Newbie / General discussionsReplies: 9Last Post: 4th Oct 2010, 02:51 -
mp4muxer: does it have command line param string output somewhere ?
By vhelp in forum Video ConversionReplies: 3Last Post: 23rd May 2010, 21:56 -
Uprezing & String Outs?
By awoody in forum EditingReplies: 2Last Post: 30th Nov 2007, 05:28