'RETURN'ing > 512
Posted in 1994
Is it just weird to me or why is it that you can pass a variable > 512 bytes to another function, and you can return INTO a variable defined > 512 bytes, but you can't return a variable > 512 bytes? This is OK: ########################################################################### FUNCTION func1() DEFINE str CHAR( 2048 ), i SMALLINT LET str = "A" FOR i = 2 to 2048 LET str = str CLIPPED,"A" END FOR CALL func2( str ) END FUNCTION FUNCTION func2( str ) DEFINE str CHAR( 2048 ) DISPLAY "String = ", str CLIPPED END FUNCTION ########################################################################### And this is OK: ########################################################################### FUNCTION func1() DEFINE str CHAR( 2048 ), i SMALLINT LET str = "A" FOR i = 2 to 2048 LET str = str CLIPPED,"A" END FOR CALL func2( str ) RETURNING str END FUNCTION FUNCTION func2( str ) DEFINE str CHAR( 2048 ), i SMALLINT DISPLAY "String = ", str CLIPPED LET str = "B" FOR i = 2 to 512 LET str = str CLIPPED,"B" END FOR RETURN str CLIPPED END FUNCTION ########################################################################### But this ISN'T OK: ########################################################################### FUNCTION func1() DEFINE str CHAR( 2048 ), i SMALLINT LET str = "A" FOR i = 2 to 2048 LET str = str CLIPPED,"A" END FOR CALL func2( str ) RETURNING str END FUNCTION FUNCTION func2( str ) DEFINE str CHAR( 2048 ), i SMALLINT DISPLAY "String = ", str CLIPPED LET str = "B" FOR i = 2 to 2048 LET str = str CLIPPED,"B" END FOR RETURN str END FUNCTION ########################################################################### Any opinions ??? (-: Robert Minter |Data Systems Support| \\\\\\_/// Programmer, Software Development | Orange, CA | ( _ _ ) internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |) bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/ I used to not know, now I know I don't know. \\_/