Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use the content of a variable as a "dictionary prefix"? 1

Status
Not open for further replies.

daikos

Programmer
Jan 7, 2010
7
0
0
BR
Hi Everyone.

Can you tell me how to use the content of a variable as a "dictionary prefix"?

Please, allow me to explain what I want to do.

Today when I want to save or update data I use:

[...]
Access:TableName.Insert() or Access:TableName.Update()

What I want to do now is something like that:

! GLO:TableName is a String(20) field

GLO:TableName = 'Employee'
[...]
Access:GLO:TableName.Insert() or Access:GLO:TableName.Update()

But, in this case the compiler shows Syntax error: Field not found:INSERT and Unknown funcion label.

Best Regards
 
Hi!

You cannot use it that way but you can always use a Reference Class and achieve it i.e.

Data Section ::
Code:
MyFM       &FileManager
MyRM       &RelationManager

Code Section ::
Code:
CASE GLO:TableName
OF 'Employee'
  MyFM &= Access:Employee
  MyRM &= Relate:Employee
OF 'Customer'
  MyFM &= Access:Customer
  MyRM &= Relate:Customer
...
END

MyFM.Insert()

MyRM.Update()

Regards
 
Thanks ShankarJ,

It works great.

Best Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top