Error: Length expected in line 9

I am writing a code to organize my table in macro language. and I get an error. Here is the code:

for (j=0;j<6; j=j+1){
jto2=floor(j/2);
if (jto2==j/2) {
indxNoy=“y”+jto2;}
else {
indxNox=“x”+jto2;}
}
indxNox.print

Shouldn’t that last line be:
print(indxNox);

Also you might want to learn to indent the code and place the curly brackets also indented, otherwise it is quite difficult to read.

But I need to print print(indxNox).

That makes no sense. What is that you want to print.

@gabriel
I need to print all indxNox.I need to check them so I need to print them.

Hi @Zeynab_Mousavi,

if you want to print a value several times, just put the print(variable); command inside your for loop. The curly parentheses must close after the print command.

Btw. you can help us helping you by opening one thread where you explain us a bit what you want to achieve and we help you step by step. Opening 4 forum threads in parallel makes things more complicated to follow.

Cheers,
Robert

2 Likes

@haesleinhuepf Thanks. Because they were 4 questions and I realized one long question is less attractive than 4 small questions.