Statistics: Posted by angros47 — Mon Dec 07, 2020 9:24 am
Code:
DECLARE SUB SetVals (ArrayIn() AS INTEGER)DIM SHARED test(1) AS INTEGERtest(0) = 500test(1) = 900CLSPRINT "Before sub call"PRINT "test(0) "; test(0)PRINT "test(1) "; test(1)PRINT "--------------------------------------"CALL SetVals(test())PRINT "After sub call"PRINT "test(0) "; test(0)PRINT "test(1) "; test(1)PRINT "--------------------------------------"SUB SetVals (ArrayIn() AS INTEGER)PRINT "Start sub call"PRINT "test(0) "; test(0)PRINT "test(1) "; test(1)PRINT "ArrayIn(0) "; ArrayIn(0)PRINT "ArrayIn(1) "; ArrayIn(1)PRINT "--------------------------------------"ArrayIn(0) = 400ArrayIn(1) = 200PRINT "End sub call"PRINT "test(0) "; test(0)PRINT "test(1) "; test(1)PRINT "ArrayIn(0) "; ArrayIn(0)PRINT "ArrayIn(1) "; ArrayIn(1)PRINT "--------------------------------------"END SUB
Code:
Before sub calltest(0) 500 test(1) 900 --------------------------------------Start sub calltest(0) 500 test(1) 900 ArrayIn(0) 500 ArrayIn(1) 900 --------------------------------------End sub calltest(0) 400 test(1) 200 ArrayIn(0) 400 ArrayIn(1) 200 --------------------------------------After sub calltest(0) 400 test(1) 200 --------------------------------------
Statistics: Posted by Erik — Sun Jun 21, 2020 4:49 pm
Code:
DIM SHARED a(2)a(1) = 10PRINT "before the call:"; a(1)f a(1)PRINT "after the call:"; a(1)SUB f (v) PRINT "in the sub before modifying:"; a(1) v = 2 PRINT "in the sub after modifying:"; a(1)END SUB
Statistics: Posted by RETROQB45 — Thu Jun 04, 2020 6:34 am