Click here to Skip to main content
16,006,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Character conversion in .NET Pin
Paul Selormey11-Jan-05 11:30
Paul Selormey11-Jan-05 11:30 
GeneralGet access to an object during runtime from its process Pin
Dany McCarthy10-Jan-05 13:42
Dany McCarthy10-Jan-05 13:42 
GeneralRe: Get access to an object during runtime from its process Pin
Heath Stewart10-Jan-05 20:01
protectorHeath Stewart10-Jan-05 20:01 
GeneralRe: Get access to an object during runtime from its process Pin
Dany McCarthy11-Jan-05 14:50
Dany McCarthy11-Jan-05 14:50 
GeneralStock Market Simulation Pin
8raker10-Jan-05 13:00
8raker10-Jan-05 13:00 
GeneralRe: Stock Market Simulation Pin
Colin Angus Mackay10-Jan-05 13:46
Colin Angus Mackay10-Jan-05 13:46 
GeneralRe: Stock Market Simulation Pin
8raker11-Jan-05 1:17
8raker11-Jan-05 1:17 
GeneralRe: Stock Market Simulation Pin
Colin Angus Mackay11-Jan-05 1:52
Colin Angus Mackay11-Jan-05 1:52 
Code Project lost my original post so I'll try again.

To loop a set number of times use a for loop like this:
for(int i=0; i<30; i++)
{
    // Insert the code you want to repeat between the braces
}
I'll break each section down so you can see what it does.

int i=0; This sets up a variable i which we use to count the iterations (i.e. the number of times the loop will repeat itself) and we set that variable to zero to start with (you can set it to any number you like depending on your circumstances, but because our problem is simple zero will do just fine.

i<30; This is the condition that is used to determine whether the loop is to keep repeating. This says that while i is less than 30 then repeat.

i++ This is what happens to i at the end of each iteration. In this case we add one (++ is the increment operator). You can specify anything you like depending on your situation, however since this is a simple repeat 30 times we'll just add one.

Does this help?


Do you want to know more?
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums


Upcoming talk:
SELECT UserName, Password FROM Users
-- Getting unauthorised access to a SQL Server, and how to prevent it.

GeneralSyncronize Windows Forms DataGrid with DataSet Pin
epinaud10-Jan-05 11:01
epinaud10-Jan-05 11:01 
GeneralRe: Syncronize Windows Forms DataGrid with DataSet Pin
Heath Stewart10-Jan-05 19:54
protectorHeath Stewart10-Jan-05 19:54 
Generalproblem in opening a web application project Pin
panky_710-Jan-05 10:56
panky_710-Jan-05 10:56 
GeneralRe: problem in opening a web application project Pin
panky_710-Jan-05 12:02
panky_710-Jan-05 12:02 
GeneralRe: problem in opening a web application project Pin
Heath Stewart10-Jan-05 20:03
protectorHeath Stewart10-Jan-05 20:03 
GeneralRe: Missing / searching 2nd DataItem as independant index in list/combobox Pin
Rob Graham10-Jan-05 10:56
Rob Graham10-Jan-05 10:56 
GeneralDeleting a Row from a DataSet in a DataGrid Pin
joschmo8010-Jan-05 9:08
joschmo8010-Jan-05 9:08 
GeneralRe: Deleting a Row from a DataSet in a DataGrid Pin
DougW4810-Jan-05 15:36
DougW4810-Jan-05 15:36 
GeneralRe: Deleting a Row from a DataSet in a DataGrid Pin
Heath Stewart10-Jan-05 20:09
protectorHeath Stewart10-Jan-05 20:09 
GeneralRe: Deleting a Row from a DataSet in a DataGrid Pin
joschmo8011-Jan-05 1:56
joschmo8011-Jan-05 1:56 
GeneralAccess Security for window based Pin
caheo10-Jan-05 8:48
caheo10-Jan-05 8:48 
GeneralRe: Access Security for window based Pin
Heath Stewart10-Jan-05 20:14
protectorHeath Stewart10-Jan-05 20:14 
QuestionHow to create a typed DataSet at run-time without type definition files (.xsd or .dtd)? Pin
huckfinn10-Jan-05 7:30
huckfinn10-Jan-05 7:30 
Generalcomparing arrays Pin
sciamachy10-Jan-05 6:50
sciamachy10-Jan-05 6:50 
GeneralRe: comparing arrays Pin
Judah Gabriel Himango10-Jan-05 8:01
sponsorJudah Gabriel Himango10-Jan-05 8:01 
QuestionCan I use webservice to download a file to my local app? Pin
Joshscorp10-Jan-05 6:46
Joshscorp10-Jan-05 6:46 
AnswerRe: Can I use webservice to download a file to my local app? Pin
Judah Gabriel Himango10-Jan-05 8:06
sponsorJudah Gabriel Himango10-Jan-05 8:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.