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

Logical Error

My program works fine accept that when the pattern contains information
more than one line it shows only the first line. For example if you
look into Summary the information is in more than 1 line but it shows
only the first line needs help

i=0
j=0
dim alldata(99999,30)
Function EnumerateFolder( sFolder )

Dim fso, ts, data
Set fso = CreateObject("Scripting.FileSystemObject")
Set fol = fso.Getfolder ( server.mappath(sfolder) )
For each fil in fol.files
Set ts = fil.openastextstream(1)
Do While Not ts.AtEndOfStream
data = ts.ReadLine
If test(Left(data, 4)) Then
data = ts.ReadLine
alldata(i,j)=data
End If
Loop
Next
ts.Close
End Function

EnumerateFolder "c:\txt"
for k=1 to 20
response.write(alldata(0,k))
response.write("<br>")
next

Function test(s)
Select Case s

Case "[Dat"
test = True

Case "[Nov"
j=j+1
test = True

Case "[Sub"
j=j+1
test = True

Case "[Cus"
j=j+1
test = True

Case "[Str"
j=j+1
test = True

Case "[Cit"
j=j+1
test = True

Case "[Acc"
j=j+1
test = True

Case "[Ins"
j=j+1
test = True

Case "[Las"
j=j+1
test = True

Case "[PPV"
j=j+1
test = True

Case "[Mon"
j=j+1
test = True

Case "[Cur"
j=j+1
test = True

Case "[Typ"
j=j+1
test = True

Case "[Lan"
j=j+1
test = True

Case "[CRC"
j=j+1
test = True

Case "[Eve"
j=j+1
test = True

Case "[Sum"
j=j+1
test = True

Case "[Box"
j=j+1
test = True

Case "[MD"
j=j+1
test = True

Case "[Con"
j=j+1
test = True

End Select
End Function

PROCESS DATA
------------
NSMITH4
PPV / VOD Research - Dispute - 1st Time - 711579
EDWARD CAMPBELL
5 WHEELER AVE APT 2
BRIDGEPORT CT, 06606
006-0416-08
06/21/2001
06/29/2006
No
186.52
Optimum Voice
Dispute - 1st Time
English
Yes
#77922 6/29, #78306 6/29, #77716 6/28, #77312 6/28
cust states that they and no one in the household ever
2,SABKDTHBF,Yes,Yes,Yes,Yes
651789
ACTUAL DATA
-----------
[Date]
Sat Aug 05 14:06:12 EDT 2006

[Novell ID]
NSMITH4

[Subject]
PPV / VOD Research - Dispute - 1st Time - 711579

[Customer's Name]
EDWARD CAMPBELL

[Street]
5 WHEELER AVE APT 2

[City, State, Zip]
BRIDGEPORT CT, 06606

[Account Number]
006-0416-08

[Install Date]
06/21/2001

[Last Known Event Date]
06/29/2006

[PPV Hold]
No

[Monthly Rate]
186.52

[Current Services]
Optimum Voice
OOL FamilyorAbv
OR$20Discount
iO Silver Pkg
iO Box
PPOF
Addset: C/Rdy
OV World Call
OV Ported Number

[Type of Request]
Dispute - 1st Time

[Language]
English

[CRC PIN Instructions]
Yes

[Event Numbers/Date Range]
#77922 6/29, #78306 6/29, #77716 6/28, #77312 6/28

[Summary]
cust states that they and no one in the household ever
ordered those ppv movies.cust requesting credit of
$35.80.

[Box Verification by Customer]
2,SABKDTHBF,Yes,Yes,Yes,Yes

[MD Page ID]
1

[Control Number]
651789

Aug 9 '06 #1
1 1113
Eric wrote:
Do While Not ts.AtEndOfStream
If test(Left(data, 4)) Then
data = ts.ReadLine
alldata(i,j)=data
End If
Loop
[Summary]
cust states that they and no one in the household ever
ordered those ppv movies.cust requesting credit of
$35.80.

[Box Verification by Customer]
2,SABKDTHBF,Yes,Yes,Yes,Yes

Considering the input and code above, it looks like [without actually
running a test] the problem is caused by the following sequence of
events:
1. test() function encounters [Summary] line and returns true
2. The ReadLine method populates the data variable with the next line
"cust states.."
3. The alldata(i,j) array element is populated with the data variable
4. Your data variable now doesn't satisfy the cases in the test()
function so the remaining lines are skipped, until it reaches [Box
Verification...]

Try inserting some debugging lines to help you see what's going on,
e.g. response.write(data) just after you've read it from the stream.

Aug 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
6
by: Hari Om | last post by:
Here are the details of my error log files: I execute the command and get following message at console: ---------------------------------------------------------------------- ../sqlldr...
7
by: Charles Crume | last post by:
Hello all; I have used dBASE, and other computer languages/databases, for years. They all have a logical field type. However, the version of MySQL used by the ISP hosting my site does not...
80
by: Christopher Benson-Manica | last post by:
Of course one can get the effect with appropriate use of existing operators, but a ^^ operator would make for nice symmetry (as well as useful to me in something I'm working on). Am I the only one...
23
by: Cor | last post by:
Hi group, A question to the group, would it not be for a lot of the users better when there was beside "Option strict on" an "Option logical Strict on". I was automaticaly writting...
2
by: ThunderMusic | last post by:
Hi, I have a value that contains flags that I must get using a bitmask. I tryied with the && operator, but the compiler outputs this error : Operator '&&' cannot be applied to operands of type...
0
by: Roald | last post by:
I am working on an application that needs to implement logical deletes instead of removing the records permanently. The logical delete works by setting 3 fields (deleted flag, date and user). I...
14
by: blueboy | last post by:
Hi, I am planning to automate a nighty restore of a DB on another server can someone point me in the right direction with the SQL script to modify the logical file names to the correct path and...
11
by: Dominic Vella | last post by:
I am using MS-Access2000. I can't seem to set the default values for Logical type fields. I start with Dim dbsTmp As Object ' I think it's DAO.Database Set dbsTmp =...
7
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.