Hi!
i try to use string as variable name in a forloop my problem is tahat my if insturktion not allow strings as variable name.
my declaration is
var
aForSend : ARRAY [1..3,1..6] OF STRING;
bSmsNr1InUse : BOOL;
bSmsNr2InUse : BOOL;
bSmsNr3InUse : BOOL;
bSmsNr4InUse : BOOL;
bSmsNr5InUse : BOOL;
bSmsNr6InUse : BOOL;
k: INT;
end_var
program
FOR k:=1 TO 6 BY 1 DO
IF (concat('bSmsNr',concat(INT_TO_STRING(k),'InUse'))) THEN
aForSend[3,k]:='1';
ELSE
aForSend[3,k]:='0';
END_IF
END_FOR
i get error cannot convert type string (255) to type bool
//Dennis
i try to use string as variable name in a forloop my problem is tahat my if insturktion not allow strings as variable name.
my declaration is
var
aForSend : ARRAY [1..3,1..6] OF STRING;
bSmsNr1InUse : BOOL;
bSmsNr2InUse : BOOL;
bSmsNr3InUse : BOOL;
bSmsNr4InUse : BOOL;
bSmsNr5InUse : BOOL;
bSmsNr6InUse : BOOL;
k: INT;
end_var
program
FOR k:=1 TO 6 BY 1 DO
IF (concat('bSmsNr',concat(INT_TO_STRING(k),'InUse'))) THEN
aForSend[3,k]:='1';
ELSE
aForSend[3,k]:='0';
END_IF
END_FOR
i get error cannot convert type string (255) to type bool
//Dennis