Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   query to run this function (http://www.go4expert.com/forums/query-run-function-t22595/)

sriram05in 1Jul2010 10:48

query to run this function
 
I have created a programme to run a function. This program will run for 10 times. My question is I want system to run the program less than 10 times ( for example 6 times) and stop immediately . I do not want to change the condition in while statement. Please guide me.
namespace Tekla.Technology.Akit.UserScript
{
public class Script
{
public static void Run(Tekla.Technology.Akit.IScript akit)
{
int a;
a=1;
while ( a < 10 )
{
akit.Callback("acmd_update_marks_all", "", "main_frame");
akit.Callback("acmdRemoveAllMarkChangeSymbols", "", "main_frame");
akit.Callback("grOpenNextDrawingCB", "", "main_frame");
akit.PushButton("gr_open_save_dr_editor_yes", "gr_open_drawing_confirm_instance");
a=a+1;
}
}
}
}
please send your reply to sriram05in@yahoo.co.in

xpi0t0s 2Jul2010 15:16

Re: query to run this function
 
> please send your reply to

Sorry, that doesn't work here. You post here, you read your answer here.

> Posts: 1

Ah, I see. At a guess you're just spamming all the programming forums you can find with the same question and hoping we'll just drop the answer directly into your inbox. Good luck with that. Most people can see through such laziness (and in fact most don't bother replying to such a timewaster).

http://www.csharphelp.com/forum/topi...is-programming

OK, only one other. That's not bad; I've seen posts to a lot more than that in the past.

Well, anyway, I do have an actually useful comment to make. If you can't change the while, is there something else you can change to make the loop only execute 6 times? What if a isn't initialised to 1, for example? But why wouldn't you want to change the while; this obfuscates the code, and a isn't used in the loop so the values don't really matter; it's just a mechanism for repeating the loop contents the required number of times. Is this an academic exercise?


All times are GMT +5.5. The time now is 09:07.