473,405 Members | 2,171 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,405 software developers and data experts.

ReaderVar.Peek <> -1

Hi All! Need some advice on my code.

[Do While (readerVar.Peek <> -1)] --> Doesnt this line suppose to terminate the loop when it comes to the end of the file and have no more line to read? In my program it just went on reading the lines over and over again when i wanted it to open another new file when it has finish reading all the line in one file.

readerVar = IO.File.OpenText("D:\project1\ANN\" & File(i)) ---> Will this line work? I want it to load a new file everytime it is done with the old file but it always ended with error when i try to run the program.

Another question is in my sub program Sparsecode(Line1, matrixA), i made used of stringbuilder and had this line --> result.Append(sparse(position))
after which i took out the individual chars and put it in arrays. I do not want it in string so i tried converting it to double using CDbl but it doesnt work, Came up error exception when i tried to run it. Why is it so?


Thanks!


Expand|Select|Wrap|Line Numbers
  1. Dim FileName As String
  2.  
  3.         Dim File(12) As String
  4.         FileName = Dir("D:\project1\ANN\*Chain*")
  5.         Do While FileName <> ""
  6.  
  7.             File(x) = FileName
  8.             x += 1
  9.             FileName = Dir()
  10.  
  11.         Loop
  12.  
  13.  
  14.  
  15.         Dim readerVar As IO.StreamReader
  16.         Dim source1, source2, Line1, Line2 As String
  17.         Dim n, i As Integer
  18.         Dim matrixA(0 To 273) As String
  19.         Dim Desired(0 To 3) As String
  20.         i = 0
  21.  
  22.  
  23. For i = 0 To 12
  24.  
  25.             readerVar = IO.File.OpenText("D:\project1\ANN\" & File(i))
  26.  
  27.             Do While (readerVar.Peek <> -1)
  28.  
  29.                 source1 = readerVar.ReadLine
  30.                 source2 = readerVar.ReadLine
  31.                 source1 = ("XXXXXX" & source1 & "XXXXXX")
  32.                 For n = 0 To (source1.Length - 13)
  33.  
  34.                     Line1 = source1.Substring(n, 13)
  35.                     Line2 = source2.Substring(n, 1)
  36.                     Sparsecode(Line1, matrixA)
  37.                     SSE(Line2, Desired)
  38.  
  39.  
  40.  
  41.                 Next
  42.  
  43.             Loop
  44.                readerVar.close()
  45.  
  46.         Next
May 29 '07 #1
1 1048
please ignore this thread!! SORRY!
May 30 '07 #2

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

Similar topics

2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: JezB | last post by:
I'm binding a DataGrid web-control to data fetched from a database. However some of my data fields contain text that is within <...> characters - I notice that everything between the <> is...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: mike | last post by:
I've got some code like this: gametype_id = Request.Form("gametype_id") response.write "<br>gametype_id from form>" & gametype_id & "<" response.write "<br>gametype_id from database>" &...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
14
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the...
3
by: Josh Valino | last post by:
Hi, I have a client that has our product and in one of the aspx files, there is code like this: <%= SomePublicProperty %> where the public property returns a string. In the test...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.