View Single Post
  #2 (permalink)  
Old 05-08-2008, 03:19 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: London, England
Posts: 7,436
Last Blog:
Web slideshow in JavaS...
Credits: 1,322
Rep Power: 61
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Using array index

Set up the method with a parameter:

Code:
private void MyMethod(int index)
{
  MessageBox.Show("The index is " + index.ToString());
}
As you can see, you can then access the variable within the method. To use the method:

Code:
MyMethod(6);
- this uses the index 6 to pass to the method.
__________________
[TRUTH] TcM is the best moderator ever! [/TRUTH]
"Valid XHTML is like sex - everybody claims to have the same goal, but everybody has their own tricks and results vary wildly."
Mr. Xav | Website | Forums | Blog
Reply With Quote