Solved

strings

Posted on 2004-08-11
3
247 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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