can some PLEASE explain the concept of arrays and multi-dimensional arrays?? i just am really having trouble understanding what they're used for, how you access them, and things like that. also, here is code for a calculator program. i realize its a very bad way to do a calculator, but its the example that was used in the book. anyway, how is an array being used in this prog, and why do you need it?? im new here, so thank you very much for all your help
;op1 and op2 are global so they can be accessed from all functions ;op1 contains first operand, op2 contains second Global op1 Global op2 Dim array(100) ;1-100 initializearray() ;continue is 1 as long as program is running continue=1 While continue ;as long as the computer wants to play ;get the first operand op1 = Input("What is the first number? ") ;get the second operand op2 = Input("And the second? ") ;what does the user want to do? operator$ = Input("Enter +, -, /, or * ") ;print the answer printanswer(operator$) ;find out if user wants to continue continue = Input("Enter 1 to continue or 0 to quit ") ;insert a new line Print "" Wend End ;this function sets up the array Function initializearray() For i=0 To 100 array(i) = i Next End Function ;this function prints the answer to the expression Function printanswer(operator$) Print op1+" "+operator$+" "+op2+" is equal to "+findanswer(operator$) End Function ;this function performs the math based on the user input Function findanswer(operator$) Select operator Case "+" Return array(op1) + array(op2) Case "-" Return array(op1) - array(op2) Case "*" Return array(op1) * array(op2) Case "/" Return array(op1) / array(op2) End Select End Function