Hi,

You said "V12 uses global variables to refer to the database or tables".

V12 doesn't really do that.  The calls to create or open a V12 
database or table return a reference, and you can store these 
references anyway you wish.  For example to open a V12 database, you 
might use code like this:

  -- Open the database file
   xDB = new(XTRA "V12dbe", sDatabaseFileName, "ReadOnly", "")

Then you can open a table like this:
   xTable1 = new(XTRA "V12table", pxDB), "someTableName1")

And another table in a similar way
   xTable2 = new(XTRA "V12table", pxDB), "someTableName2")

Or, if you have a list of names, you can open all tables  by 
iterating over the list.  Then, you probably want to create a list of 
table references:

   lTableNames = ["tableName1", "tableName2", ....  "tableNameN"]  -- 
list of table names

   lTableRefs = []
   repeat with thisTableName in lTableNames
      thisTableRef = new(XTRA "V12table", pxDB), thisTableName)
      append(lTableRefs, thisTableRef)
   end repeat


(You could specify that both of these lists are global:

global lTableNames
global lTableRefs

Then whenever you want to get a reference to a table using its name 
you would do something like this:
on GetRefToTable tableName
    where = getOne(lTableNames, tableName)  -- find the name
    thisTableRef = lTableRefs[where]  -- use its location as an index 
into the list of refs
    return thisTableRef
end

Then use the returned "tableRef" to do the rest of your database work.

Hope this helps.

Irv




At 8:51 PM -0600 3/27/02, Hermann Brandi wrote:
>Hello everyone!
>
>I've made a map system using V12 as a database. I have 20 tables that have
>approximately 80 records each. V12 uses global variables to refer to the
>databases or tables. I store the name of the tables in a linear list. My
>original idea was to call each name of the list using a REPEAT loop from 1
>to the count of the linear list. I use a local variable to store the name of
>the table. The problem comes when V12 doesn't recognize the local variable
>as a container of the name of the table. Is there a way to convert the local
>variable to its content? I hope you understand me.
>
>Thank you in advance.
>
>
>[To remove yourself from this list, or to change to digest mode, go 
>to http://www.penworks.com/lingo-l.cgi  To post messages to the 
>list, email [EMAIL PROTECTED]  (Problems, email 
>[EMAIL PROTECTED]). Lingo-L is for learning and helping with 
>programming Lingo.  Thanks!]


-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to