Jump to content

Recommended Posts

Posted

Hi, Fiz here. I'm new to this DCS wondered if someone could assist with the following loop to get it to work. (I know how to do it in while and do loops) I would like to use a FOR loop for other things. It should simply count from 1 to 10.

//This FOR loop which compiles in TARGET script editor but throws runtime error "symbol not found": "for"
int ctr=1;
for (ctr , ctr <= 10, ctr+1);
    {
    printf("This number is  %d which is less than 11\xa",ctr);
    }

Has anyone got any idea why the FOR loop doesn't work

I know that TARGET script  is slightly different from the C language but it is pretty close.

Posted

I'm about as far from an expert on TARGET as it gets.

But that semicolon at the end of the

for ();

bracket looks pretty out of place to me.

Posted (edited)
15 minutes ago, 352nd_Hoss said:

PM Sedenion, he should be able to help you out

I'm kinda against such ideas. It's a public question and the answer should be public. When it's discussed in PMs, people tend to not post a follow-up, and the next person with a similar question won't be able to learn anything from it.

This forum exists so we can all help each other, and that only works when solutions are as public as the questions. And in some cases, the way to the solution is even more relevant than the solution itself.

Edited by Yurgon
  • Like 2
Posted

Hi Yurgon,

Yes I know that the ; semicolon is there it will not compile in TARGET without it.

I also note your further comment about keeping it public... I agree.

The FOR word is definitely in the TARGET script as it goes blue when you try to use it. It just doesn't do like a normal for loop syntax of C. e.g.

for (ctr=0 ; ctr <= 10; ctr++)
    {
    printf("This number is  %d which is less than 11\n, ctr);
    }

So I'm just looking for some help in the TARGET script syntax of it really.

352nd_Hoss thanks for the info about Sedenion. If there is no reply here for a couple weeks I will ask for the help with Sedenion. (Much obliged). Perhaps Sedenion will see it and answer.

Fiz.

Posted
1 hour ago, FIZ said:

The FOR word is definitely in the TARGET script as it goes blue when you try to use it. It just doesn't do like a normal for loop syntax of C. e.g.

Interesting. My copy of the manual says:

Quote

The following Keywords are supported

char, byte, short, word, int, alias, float, struct, include, if - else, do - while, while, return, goto, break

Maybe the for loop just isn't part of TARGET.

In any case, if you described what it is that you are actually trying to achieve, chances are that someone knows a good solution.

(Personally, I avoid TARGET like the plague, and don't know much about it)

Finally, the question doesn't seem to be specific to the A-10C, so this is likely a better place to find help from people who know their way around TARGET: https://forums.eagle.ru/forum/336-thrustmaster/

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...