Hi,
I am getting a weird error when I try to do a check on the length of a string (to see if its null or zero) when the string gets past a certain size. I'm enclosing some code that you can use to recreate the error (in my code, I'm not using the DO LOOP, I'm just enclosing it so you can get a string the size that seems to error).
DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".
DO counter = 1 TO 19244:
stringToCheck = stringtoCheck + "Q".
END.
DISPLAY (stringtoCheck = ? OR length(stringToCheck) = 0).
This doesn't make any sense to me. A string that is 19,244 characters long is valid, there shouldn't be a problem with checking it's length like that. If I put the length check into a variable like below it works fine.
DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".
DEF VAR stringLength AS INTEGER NO-UNDO.
DO counter = 1 TO 19244:
stringToCheck = stringtoCheck + "Q".
END.
stringLength = LENGTH(stringToCheck).
DISPLAY (stringtoCheck = ? OR stringLength = 0).
This is very bizarre behavior. Does anyone know why this might be happening? I can think of no reason why it should be a problem to check the length of a string as part of an expression like I'm doing.
I am getting a weird error when I try to do a check on the length of a string (to see if its null or zero) when the string gets past a certain size. I'm enclosing some code that you can use to recreate the error (in my code, I'm not using the DO LOOP, I'm just enclosing it so you can get a string the size that seems to error).
DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".
DO counter = 1 TO 19244:
stringToCheck = stringtoCheck + "Q".
END.
DISPLAY (stringtoCheck = ? OR length(stringToCheck) = 0).
This doesn't make any sense to me. A string that is 19,244 characters long is valid, there shouldn't be a problem with checking it's length like that. If I put the length check into a variable like below it works fine.
DEF VAR counter AS INTEGER NO-UNDO.
DEF VAR stringToCheck AS CHARACTER NO-UNDO INITIAL "".
DEF VAR stringLength AS INTEGER NO-UNDO.
DO counter = 1 TO 19244:
stringToCheck = stringtoCheck + "Q".
END.
stringLength = LENGTH(stringToCheck).
DISPLAY (stringtoCheck = ? OR stringLength = 0).
This is very bizarre behavior. Does anyone know why this might be happening? I can think of no reason why it should be a problem to check the length of a string as part of an expression like I'm doing.