3 Replies - 1888 Views - Last Post: 02 June 2008 - 05:34 PM Rate Topic: -----

#1 trilobite  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-March 08

Displaying string from input boxes in opposite order

Posted 02 June 2008 - 12:29 PM

Hi

I would appreciate some help with this code...I am trying to write a program that accepts four words as input from input boxes, then displays those words in the opposite order ie starting with the last one that was input and finishing with the first.
Here is what I have come up with so far...

Dim strInput As String
Dim intCount As Integer

For intCount = 1 To 4
strInput = InputBox("Enter word: " & CStr(intCount))
ListBox.Items.Add(strInput)

Next intCount



Is This A Good Question/Topic? 0
  • +

Replies To: Displaying string from input boxes in opposite order

#2 Zhalix  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 260
  • Joined: 07-May 08

Re: Displaying string from input boxes in opposite order

Posted 02 June 2008 - 04:21 PM

Um, I assume you mean display it in the listbox in the opposite order?

Dim strInput As String
Dim intCount As Integer

For intCount = 1 To 4
	strInput = InputBox("Enter word: " & intCount)
	lstList.AddItem strInput, 0
Next intCount



All I did was I specified to add the new list item in the first slot "0", and that bumped everything up one slot.

Is this what you needed?
Was This Post Helpful? 0
  • +
  • -

#3 trilobite  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 19-March 08

Re: Displaying string from input boxes in opposite order

Posted 02 June 2008 - 05:22 PM

Yep

Thank you.
Was This Post Helpful? 0
  • +
  • -

#4 Zhalix  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 260
  • Joined: 07-May 08

Re: Displaying string from input boxes in opposite order

Posted 02 June 2008 - 05:34 PM

Cool.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1