CAPTURE PROBLEM IN IF ELSE

Screenshot (116)

        BLOCK:ConstantString
      => VAR @ABC
    ENDBLOCK

    IF STRINGKEY @ABC EqualTo "balance"
    BLOCK:ConstantString
      value = "CREDITS"
      => VAR @AB
    ENDBLOCK
    ELSE
    BLOCK:ConstantString
      value = "NO CREDITS"
      => CAP @AB1
    ENDBLOCK
    END

CAPTURE ISNT WORKS FOR ME…WHEN I USE ANY FUNCTTION IN IF ELSE THEN OUTSIDE OF IF ELSE THE VARIABLE NOT WORK FOR ME

BUT IN LOG ITS SHOWING AS CAPTURE

>> Constant String (ConstantString) <<

Set constant value

 

>> Constant String (ConstantString) <<

Set constant value NO CREDITS

Variable AB1 marked for capture

if you declare a variable in a IF or WHILE statement it will goes out of scope when the statement ends. this should work :

BLOCK:ConstantString
LABEL:Initialize ABC
  => VAR @ABC
ENDBLOCK

BLOCK:ConstantString
LABEL:Initialize AB
  => VAR @AB
ENDBLOCK

BLOCK:ConstantString
LABEL:Initialize AB1
  => CAP @AB1
ENDBLOCK

IF STRINGKEY @ABC EqualTo "balance"
BLOCK:ConstantString
LABEL:Set AB
  value = "CREDITS"
  => VAR @AB
ENDBLOCK
ELSE
BLOCK:ConstantString
LABEL:Set AB1
  value = "NO CREDITS"
  => CAP @AB1
ENDBLOCK
END
2 Likes

Thanks brother…

its working now

1 Like