Solved

strings

Posted on 2004-08-11
3
242 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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