You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code leads to the error: Variable name "i" already defined (check_syntax) [E]
CLASSzcl_demo DEFINITION.
PUBLIC SECTION.
METHODStestIMPORTING
word1 TYPE string
word2 TYPE string PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASSzcl_demo IMPLEMENTATION.
METHODtext.
DATA(word1_table) =VALUE string_table( FOR i=0 WHILE i<strlen( word1 )
( substring( val = word1 off = i len =1 ) ) ).
DATA(word2_table) =VALUE string_table( FOR i=0 WHILE i<strlen( word2 )
( substring( val = word2 off = i len =1 ) ) ).
ENDMETHOD.
ENDCLASS.
The second VALUE command uses the same local variable "i" what is accepted by the ABAP compiler.
But it leads to the error in exercism.
The text was updated successfully, but these errors were encountered:
The following code leads to the error:
Variable name "i" already defined (check_syntax) [E]
The second VALUE command uses the same local variable "i" what is accepted by the ABAP compiler.
But it leads to the error in exercism.
The text was updated successfully, but these errors were encountered: