Search code examples
foxprodbf

Visual foxpro table name with variable


I have to modify an old software wrote in visual foxpro (latest version) My goal is to create some temporary tables with a non-fixed name (it depends on some variable). How can I write something like: variable1="table_name" Create table variable1 (field1 int, field2 int)

and have the output file table_name.dbf?


Solution

  • Just a small change to what you wrote will do the trick:

    variable1 = "table_name"
    CREATE TABLE (variable1) (field1 int, field2 int)