11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The DIM... command tells the computer to reserve a row of boxes for the array. DIMstands for "dimension" which means "size."18 DIM A(3)30 DIM B(7),B$(4)Line 18 saves four memory boxes, one each for the variables A(0), A(l), A(2) and A(3).These boxes are for numbers and contain the number "0" to start with.Line 30 reserves eight boxes for the B() array and five for the string array B$(). Theboxes named B$(0) through B$(4) are for strings and are empty to start with.RULE: Put the DIM() statement early in the program, before the array is used in anyother statement.MAKING A LISTEnter10 REM++IN A R0W++30 DIM A$(4)35 PRINT"clr dn dn ENTER A WORD dn"40 FOR N=0 TO 445 IF N>0THEN PRINT'ANOTHER dn"50 INPUT A$(N)55 PRINT60 NEXT N100 PRINT'IN A ROW dn dn"110FORN0TO4120 PRINT A$(I);TAB(10);I130 NEXT ISAVE and run.You can use a member of the array by itself. Look at this line:40 B$(2)="YELLOW SUBMARINE"Or the array can be used in a loop. Lines 50 and 120 in the program "IN A ROW" are inloops where the index (N or I) keeps changing.171

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!