I have the module who should replace some elements of a matrix with checkboxes
addChekboxesTable[x0_] := Module[{x = x0},
For[i = 1, i <= Length[x], i++,
For[j = 1, j <= Length[x[[i]]], j++,
If[x[[i, j]] == "x",
x[[i, j]] = Checkbox[True];
]
If[x[[i, j]] == "o",
x[[i, j]] = Checkbox[False];
]
If[x[[i, j]] == "u",
x[[i, j]] = Checkbox[3, {1, 2, 3}];
]
]
]
x
]
I call the module like:
pp = addChekboxesTable[{{"Datatype", "Variable Name", "S0", "S1",
"x"}}];
And then the string is corrupted :( It has some Nulls and Times
List[List[Times["Datatype",Null],Times["Variable Name",Null],Times["S0",Null],Times["S1",Null],Times[Null,Checkbox[True]]]]
I dont know why :(( Any ideas ?
Ps: if i extract the instruction from module, outside , the code works O_O
I changed the function to the next for by adding some ";" at the end of instructions. It fixed but i dont know why O_O
addChekboxesTable[x0_] := Module[{x = x0},
For[i = 1, i <= Length[x], i++,
For[j = 1, j <= Length[x[[i]]], j++,
If[x[[i, j]] == "x",
x[[i, j]] = Checkbox[True];
];
If[x[[i, j]] == "o",
x[[i, j]] = Checkbox[False];
];
If[x[[i, j]] == "u",
x[[i, j]] = Checkbox[3, {1, 2, 3}];
];
];
];
x
]