Why is it this statment wont work:
GLOBAL Test(100) as STRING
But This Does:
LOCAL Test(100) as STRING
Thanks
GLOBAL Test(100) as STRING
But This Does:
LOCAL Test(100) as STRING
Thanks
#COMPILE EXE #DIM ALL SUB PrintIt (thedata() AS STRING) LOCAL i& PRINT "PrintIt" FOR i& = UBOUND(thedata) TO UBOUND(thedata)-5 STEP -1 PRINT VAL(thedata(i&))*1000 NEXT END SUB SUB ViewIt (thedata() AS STRING) LOCAL i& PRINT "ViewIt" FOR i& = 1 TO 5 PRINT VAL(thedata(i&))*2000 NEXT END SUB FUNCTION PBMAIN () AS LONG LOCAL i& DIM srcdata( 1 TO 30) AS STRING FOR i& = 1 TO 30 : srcdata(i&) = FORMAT$(i&):NEXT GOSUB ASUB1 PrintIt srcdata() GOSUB ASUB2 ViewIt srcdata() WAITKEY$ EXIT FUNCTION ASUB1: PRINT "ASUB1" FOR i& = 1 TO 5 : PRINT VAL(srcdata(i&)) : NEXT RETURN ASUB2: PRINT "ASUB2" FOR i& = 12 TO 17 : PRINT VAL(srcdata(i&))*10 : NEXT RETURN END FUNCTION
SUB TestIt (thedata() AS STRING * 20) LOCAL i&,b$ DIM a(0) AS STRING * 600 AT VARPTR(thedata(1)) PRINT "TestIt" b$ = a(0) STDOUT b$ END SUB
FOR Z =LBOUND( TheData,1) TO UBOUND(TheData,1) PRINT TheData(Z) NEXT
SUB PrintWholeArray (S() AS STRING) LOCAL Z AS LONG FOR Z = LBOUND (S,1) TO UBOUND(S,1) PRINT S(Z) NEXT END SUB ... PrintWholeArray v1() ' print all elements of string array V1 PrintWholeArray v2() ' print all elements of string array V2 ...
SUB PrintIt (thedata() AS STRING) STDOUT JOIN$(thedata(),$CRLF) END SUB
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment