Re: Storing a variable as a list ?


[Prev][Index][Thread]

Re: Storing a variable as a list ?



Title: RE: Storing a variable as a list ?

Try something like this:
---
prgm
  local L1                      @List
  local t                       @Temp Variable
  local a                       @Max Resistors
  local i                       @Loop variable
 
  disp "How many resistors"
  input a                       @Get Max resistors
  newlist(a) STO> L1    @Initializes size of list to 'a' elements
  for i,1,a                     @For each resistor...
    disp "Enter value of resistor" & string(i)
    input t                             @Gets your value...
    t STO> L1[i]                        @...and saves in into the list as element 'i'
    @Do whatever you want to here...
  endfor
  disp L1                       @displays the filled array.
endprgm
---
I just took yours & made it work. It is by no means the 'best' way to do this...
or the worst...
Good luck,
7ony