Solved

strings

Posted on 2004-08-11
3
244 Views
Last Modified: 2010-04-23
I still cant understand why this wont work., not that it doesnt do anything but  the if statement to say that the characters have gone beyond column 76should goto the next line but doesn't.  Can someone please help a beginner.


Public Sub WLBoard(ByVal text As String)
        Dim i As Integer
        Dim c As String
        Dim row As Integer = 0 ' Set the Row position to zero
        Dim col As Integer = 0 ' Set the Column position to zero

        For i = 0 To text.Length - 1

            c = text.Substring(i, 1)

            If c.Equals("A") Then
 'should be col instead of i*6 but i need a way to add 'spaces 'between the words
               
Call A(i*6, row)                
 col = col + 6 ' the next character is 6 columns

            End If
            If col > 76 Then
                row = row + 11 ' go down one line 11 rows
                col = 0 ' set column back to column 0
            End If
0
Comment
Question by:gbilios
  • 2
3 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11771600
have you placed a BREAKPOINT at the line that reads


  For i = 0 To text.Length - 1


and then sinlge-stepped through the code, to see what is actually happening?  That should help you figure out what is really going on, and then you can figure out how to fix it.

AW
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 11771659
What is the text you send to the WLBoard, because if there aren't 7 letters "A" in that string col will never reach 76
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 250 total points
ID: 11771663
sorry 13 times "A"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question