Re: Field's DataBases

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

Hello Sergio!

Okay, I *think* I know what you are talking about here.  smile  You are
basically wanting to store a variable name, and its value in the database
file.  This can be done with Euphoria ... sort of.  Make one sequence, say
sVars, for instance.  In sVars, you will need elements with the following
format:

{Variable Name, Value}

Here's some very untested code:

sequence
    sVars

procedure addVariable(sequence sVariableName, object xValue)

    sVars & {sVariableName, xValue}

end procedure


function getValue(sequence sVariableName)

    if not length(sVars) then
        puts(1, "Oops.  No variables declared.\n")
        return
    end if
    for i  1 to length(sVars) do
        if equal(sVariableName, sVars[i][1]) then
           return sVars[i][2]
        end if
    end for
    puts(1, "Couldn't find that variable.  Sorry.\n")
    return 0

end function

Hope this helps you out some.  I'm having to do the same thing in the
Euphoria Package compiler for user defined variables declared in EPC
makefiles.

Travis Beaty
Evans, Colorado.


-------Original Message-------
From: EUforum at topica.com
Date: Saturday, November 24, 2001 02:34:20 PM
To: EUforum
Subject: Field's DataBases
====== The Euphoria Mailing List ======
Hi Folks.
Bom dia para todos.
( Good day for all )
You just know about my English, so please, stay
patience.
I am trying to made a DataBase.
The first program creates and are the modifier of
all DataBases structures. He handles names, types
and sizes of all DataBase's fields. No probles in
this step.
Another program will open everyone DataBase if
he is created with the above refer program.
After it, i can read field's names inside the
opened DataBase, like this:
name_first_field  line_config_database[1..10]
or read type's fields as
type_second_field  line_config_database[...and
so go.
The problem is: I want use this field's name like
as any variables, but i don't know how declare it
and Euphoria don't works with pointers like "C"
I believe you will understand better in down
lines.
If i know how variables the program will works,it
is easy, just declare it like as:
sequence NAME -- no problems
But the program was running and in any moment
it receives a information that it will need
works with a new variable type sequence named
"NAME" and in the next lines, I would to do
anything like this
NAME  "Sergio Gelli"
But the variable "NAME" isn't was declared because
this program only know about its when opens the
DataBases.
How can i do it?
Exists another format to do it?
I will stay gratefully for any suggestions.
Muito obrigado pela sua atencao.
( Very thanks to your attention )
Udachi to Igor ( Spell I ok ?)
( sorry i only know this, send more)
Sergio Gelli
Jundiai SP Brasil
=^================================
This email was sent to: travis_beaty at yahoo.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu