Putting a name backwords



Programming Help Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Putting a name backwords Expand / Collapse
Author
Message
Posted 12/14/2008 11:02:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 12/15/2008 10:13:02 PM
Posts: 2, Visits: 2
Im taking a programing essentials class, and was hoping someone could help me. Its programing essentials 1, so it should be pretty easy to most people with this.

Its one of the projects in the Microsoft Visual basic 05 book. Ill explain it.

So i would enter the text Benjamin Franklin(or any other text) and then once i click a button it would be displayd backwords(nilknarf nimajneb). Ive been doing fine till i came up to this part. Thank you to anyone that helps me out

Post #2060
Posted 12/15/2008 5:15:33 PM
Admin

AdminAdminAdminAdminAdminAdminAdminAdmin

Group: Administrators
Last Login: 10/13/2010 9:32:56 AM
Posts: 165, Visits: 333
You could use something like this, using the length of the input string to loop through each character and reverse it:


Dim stringLength As Long, Counter As Long
Dim singleChar As String
Dim reverseString As String

stringLength = Len(InputString)
For Counter = stringLength To 1 Step -1
singleChar = Mid(InputString, Counter, 1)
reverseString = reverseString & singleChar
Next
Post #2061
Posted 12/15/2008 10:14:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 12/15/2008 10:13:02 PM
Posts: 2, Visits: 2
That is exactly what i needed. I was not sure how to do the letter positions and what kind of loop i needed. Thank you.
Post #2063
Posted 4/4/2009 9:44:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/4/2009 10:07:48 AM
Posts: 3, Visits: 7
but I think there is a function from VB that more efficient..

example :
dim a as string
a="abc"
a=StrReverse(a)
print a

CMIIW.. (Correct Me If I Wrong)
hehehe..
Post #2769
Posted 4/29/2009 12:16:16 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/11/2009 12:06:27 PM
Posts: 3, Visits: 4
StrReverse() is indeed a function that returns a string in reverse order.

Private Sub Form_Load()

Dim strMyString As String

strMyString = "Hello"

MsgBox StrReverse(strMyString)

End Sub

Sour grapes can make sweet wine.

Post #3534
Posted 5/3/2009 10:51:41 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 1/11/2010 9:48:55 AM
Posts: 14, Visits: 15
what is that?????
ehm, yes....


,,,,

(( . . ))
(( ))
(,,) (,,)
Post #3570
Posted 5/25/2009 12:05:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Banned Members
Last Login: 5/28/2009 6:51:46 PM
Posts: 8, Visits: 2
cant you just type it backwards
Post #3829
Posted 5/25/2009 12:06:16 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Banned Members
Last Login: 5/28/2009 6:51:46 PM
Posts: 8, Visits: 2
lol sry idk what you mean
Post #3830
Posted 12/10/2010 8:28:53 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 12/26/2010 8:36:23 AM
Posts: 11, Visits: 2
Can anybody post an output of this?

In a world without walls, who needs Windows?
Post #5693
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: ProgrammingHelp, Viral Unity, Matt.Hill, DaveL, Alex.D

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 9:24am

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0.234. 17 queries. Compression Disabled.