I have created a function in a select but actually want the function to be different. I am now searching on wd for the weld data but actually want to search on welddata so that I can include all the weld data not only the welddata that are defined like wd.
Appstudio code:
const module = “mRW_GoFaData”;
const task = “T_ROB1”;
const result = ;
for (let i = 1; i <= 100; i++) {
const name = “wd” + i;
try {
const type = await API.RAPID.getVariableType(module, name, task);
if (type === “welddata”) {
result.push(${name}|${name});
}
} catch (e) {
// Variabele bestaat niet, doorgaan
}
}
this.optionItems = result.join(“;”);
Rapid code:
!---------------- Welddata -------------------
PERS welddata wd1:= [12,7.5,[1.7,3.1,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]];
PERS welddata wd2:= [9.5,1.6,[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0]];
PERS welddata wd3:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd4:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd5:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd6:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd7:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd8:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd9:= [5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd10:=[5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata wd60:=[5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata test123:=[5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];
PERS welddata teste123:=[5,0,[0,0,0,100,0,0,0,0,0,0],[0,0,0,100,0,0,0,0,0,0]];