1 Replies - 1927 Views - Last Post: 03 September 2010 - 09:33 AM

#1 iwantthependrive   User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 15-February 09

Accept and display string in reverse

Posted 06 March 2009 - 06:53 AM

Description: Just add a command button(default name)Accepts string through inputbox and displays it in reverse
'My First Snippet. Hope You Like It
Private Sub Command1_Click()
Dim word As String, n As Long, i As Long, rev As String  'declaring variables
word = InputBox("Enter a string", "Reverse-String")      'accepting through inputbox
n = Len(word)                                            'determining length of string
For i = n To 1 Step -1                                   'using a loop to extract characters from beginning to start
rev = Mid(word, i, 1)                                    'extracting characters
Print rev;                                               'printing reverse string
Next i                                                   'ending loop
End Sub




Is This A Good Question/Topic? 0
  • +

Replies To: Accept and display string in reverse

#2 karthikeyan.abhijith   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 0
  • Joined: 03-September 10

Re: Accept and display string in reverse

Posted 03 September 2010 - 09:33 AM

superb!!!! it workd at 1 shot !!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1