Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am trying test my MoveNext Function in VB.NET, but it is not working. Any ideas on how to make it work on the following code:

VB
Public Function MoveNext() As Boolean

    endindex = checkWord.Length + foundIndex

    If foundIndex >= replacements.ToString.Length Then
        Return False
    Else
        Return True
    End If

End Function


What I have tried:

Tried searching on Google, but could not be able to use those solutions to solve my problem!
Posted
Updated 24-Jun-16 4:42am
v5
Comments
CHill60 6-Jun-16 11:19am    
It would help if you included the declarations for your variables.
The first problem I can see is that you are trying to subtract an integer checkWord.Length from a string foundIndex.ToString
Explain what you think the function is going to do
nqioweryuadfge 6-Jun-16 12:40pm    
I have added it now instead of subtracting it! It now looks much better now when you check the updated question.
Sergey Alexandrovich Kryukov 6-Jun-16 11:21am    
What are you talking about? What is RichTextBox1; what is its type? Full type name, please.
Your code sample is taken out of context. Please see: SSCCE.
—SA
nqioweryuadfge 6-Jun-16 12:41pm    
No,No,No Sergey! I am not talking about this RichTextBox. Thanks anyways!
Sergey Alexandrovich Kryukov 6-Jun-16 17:11pm    
If it is not "this" RichTextBox, simply tell us which is yours. Is that a problem? Which one?
—SA

1 solution

By understanding your code here i have created a small vb.net windows application to get the issue resolved in my way.

Please go through the code and let me know if any further assistance required?

Please check this link to get the project[^]

Let you know that the entire solution is in VS 2015, so please copy the code and test if you are using a lower version.

My UI:-
Click here for image[^]
 
Share this answer
 
v2
Comments
Maciej Los 8-Jun-16 16:46pm    
Sorry, but i think that your answer may help for OP, but no one else. ;(
In my opinion you should provide a way to resolve issue directly in your answer.
SRS(The Coder) 8-Jun-16 16:51pm    
You can see here that due to the question is not understandable only so many discussions are happening with not a single answer and also the file i have shared will help everyone to understand as the link is for downloading the entire windows application.(As the code file is bit lengthy and complex i added proper comment as well)

Please get it and try to run you will have a clear picture of the scenario, question and my answer as well.

Hope this makes sense.
nqioweryuadfge 9-Jun-16 7:20am    
SRS. Thanks. I will test it!
nqioweryuadfge 9-Jun-16 7:27am    
SRS. Got it. Thanks!
nqioweryuadfge 9-Jun-16 10:08am    
You can now remove it thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900