Click here to Skip to main content
16,017,488 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: pushing a command button by program code Pin
Dr_Lomax26-Jun-05 13:16
Dr_Lomax26-Jun-05 13:16 
GeneralRe: pushing a command button by program code Pin
Christian Graus26-Jun-05 16:10
protectorChristian Graus26-Jun-05 16:10 
GeneralPresentations to Video Converter Pin
Murtuza Husain Miyan Patel26-Jun-05 3:59
professionalMurtuza Husain Miyan Patel26-Jun-05 3:59 
GeneralRe: Presentations to Video Converter Pin
Dave Kreskowiak26-Jun-05 8:54
mveDave Kreskowiak26-Jun-05 8:54 
General.NET & Host Integration Server Pin
Ratnamsub25-Jun-05 22:02
Ratnamsub25-Jun-05 22:02 
GeneralNeed Serious help or i'll go crazy!!! Pin
gui3916boy25-Jun-05 17:37
gui3916boy25-Jun-05 17:37 
GeneralRe: Need Serious help or i'll go crazy!!! Pin
toxcct25-Jun-05 22:47
toxcct25-Jun-05 22:47 
GeneralRe: Need Serious help or i'll go crazy!!! Pin
Fernando Soto26-Jun-05 8:32
Fernando Soto26-Jun-05 8:32 
Hi gui3916boy;

The first problem is not reading the file. What is happening is that when you progeam gets to this line of code:

dimdata = sentence.Substring(xloc, len - 1)

in the try block of the readfile subroutine. The value of xloc for the first line of the data (2.1 3.5 +1) from the file is 3, the index of the first space character. The length of the data is 10. So you are attempting to get a substring starting at index 3 (the 4th character in the string) for a length of len - 1 which is 10 - 1 = 9. But from the index of 3 to the end of the string the length is only 6. You are trying to access data pass the end of the string which will throw an exception. Because this statement is in a try block you catch it and print a message that "Error when reading File" which is not the case in this example. The above statement should read as follows:

dimdata = sentence.Substring(xloc, len - xloc - 1)

this will account for not starting at the beginning of the string and also that string index start at zero and not one.

Another problem I see is that the xdata, xloc1, xloc2 and others are declared as Integer. When you read a value from the file into the integers the decimal part is truncated therefore a value from the file 2.1 becomes 2.

This should get you a little further along.

Fernando

Generalpublisher configuration file Pin
lagumaster25-Jun-05 16:27
lagumaster25-Jun-05 16:27 
GeneralGrid with different color rows Pin
Storas25-Jun-05 13:55
Storas25-Jun-05 13:55 
GeneralDisplay Date only from Dataset Pin
E. Ward25-Jun-05 13:20
E. Ward25-Jun-05 13:20 
GeneralRe: Display Date only from Dataset Pin
Madni Abbasi26-Jun-05 6:24
Madni Abbasi26-Jun-05 6:24 
GeneralRe: Display Date only from Dataset Pin
gharryh30-Jun-05 5:59
gharryh30-Jun-05 5:59 
GeneralNumber Pin
ADY00725-Jun-05 9:23
ADY00725-Jun-05 9:23 
GeneralRe: Number Pin
Colin Angus Mackay25-Jun-05 11:39
Colin Angus Mackay25-Jun-05 11:39 
GeneralRe: Number Pin
toxcct25-Jun-05 22:51
toxcct25-Jun-05 22:51 
GeneralRe: Number Pin
Madni Abbasi26-Jun-05 6:21
Madni Abbasi26-Jun-05 6:21 
GeneralRe: Number Pin
toxcct26-Jun-05 7:30
toxcct26-Jun-05 7:30 
GeneralRe: Number Pin
Madni Abbasi26-Jun-05 23:15
Madni Abbasi26-Jun-05 23:15 
GeneralCrystal Report, Parameter promting Pin
Madni Abbasi25-Jun-05 6:51
Madni Abbasi25-Jun-05 6:51 
GeneralILMerge Problems Pin
Dr_Lomax25-Jun-05 6:02
Dr_Lomax25-Jun-05 6:02 
GeneralRe: ILMerge Problems Pin
Dave Kreskowiak26-Jun-05 8:34
mveDave Kreskowiak26-Jun-05 8:34 
GeneralRe: ILMerge Problems Pin
Dr_Lomax26-Jun-05 8:42
Dr_Lomax26-Jun-05 8:42 
GeneralRe: ILMerge Problems Pin
Dave Kreskowiak26-Jun-05 12:15
mveDave Kreskowiak26-Jun-05 12:15 
GeneralRe: ILMerge Problems Pin
Dr_Lomax26-Jun-05 13:13
Dr_Lomax26-Jun-05 13:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.