Re: Memory

new topic     » goto parent     » topic index » view thread      » older message » newer message

>    Could someone tell me if there is a way to set aside memory in one
> Euphoria program, use it for certain perposes, quit the program and
> return to Dos. Then load another Euphoria program and be able to use hte
> exact same memory area without the fear of the contents being overwrote
> be another prevously run program?
>    I am working on a password program that ask for id when the computer
> is started, then saves the necessary info to memory in incoded form. I
> have done this in basic and it seems to work well, but often the
> information is written over.

why don't you just save the encripted form of the password to a
binary file and then retrieve it later...  pour exemple:

-- this is the .ex file that saves the password
  integer fn
  sequence password

  password = encrypt("blah")  -- supposing you have a function called
           -- 'encrypt' that encrypts it
  fn = open("password.dat","wb")
    for i = 1 to length(password)  -- there's probably an easier way
           -- to do this
      puts(fn,password[i])
    end for
  close(fn)
-- this is the .ex file that reads the password
  integer fn
  object tempi,tempj
  sequence password

  tempj = {}

  fn = open("password.dat","rb")
    while tempi != -1 do     -- think -1 is the code for eof...  not
                -- sure, tho
      tempi = getc(fn)
      tempj = tempj & fn
    end while
  close(fn)
  password = decrypt(tempj)  -- supposing you have a function called
                   -- decrypt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu