1. Re: Variable naming in Euphoria

Hello Futures8,

>if reccount() - recno() < 10
>      k = reccount() - recno()
>else
>      k = 10
>endif
>
>for i = 1 to k
>       j = alltrim(str(i)) -- makes j a character              --
>respresentation of the  integer i
>       store val(CLOSE) to Price&j
>       skip
>next i

I don't know exactly why you would need them to be
variable names specifically so I'll show you an
example of how to do something similar with sequences.

  if reccount() - recno() < 10 then
    k = reccount() - recno()
  else
    k = 10
  end if

  sequence price
  price = {}

  for i = 1 to k do
    price = append (price, getPrice(i)) -- this assumes a
    -- function getPrice is declared and its only parameter
    -- is the record number end for
  end for

  -- to get a specific price, say price5, do this
  ? price [5] -- prints the 5th price in the list

I hope this gives you an idea of how to do what
you want in Euphoria.

later,
Lewis Townsend
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu