Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADDOBJECT
Message
From
16/09/1999 05:38:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/09/1999 12:54:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00264974
Message ID:
00265363
Views:
18
>Cetin,
>
>When I try to run your first example I get an error on the EVAL function saying that cursor01 does not exist.


Steven,
It's a forgotten dot before "Cursor". It should be eval(".Cursor"+...

Here is a tested version :) (In VFP5 samples are in home()+"samples", if VFP6 you should change it to _samples and be sure your _samples is pointing to a correct path - check tools\options\file locations)
* Create a form 
*(in designer so it would have a DE - otherwise you should create it too)
* Add a command button at bottom, right corner
* Put this code in command button click and run
DIMENSION myCursors[3]
myCursors[1] = "employee"
myCursors[2] = "customer"
myCursors[3] = "orders"
WITH thisform.dataenvironment
  .CloseTables
  FOR ix = 1 to alen(myCursors)
    .AddObject("Cursor"+padl(ix,2,"0"),"Cursor")
    WITH eval(".Cursor"+padl(ix,2,"0"))
      .Database = home()+"samples\data\testdata.dbc"
      .Cursorsource = myCursors[ix]
      .Alias = myCursors[ix]
    ENDWITH
  ENDFOR
  .OpenTables
ENDWITH

thisform.addobject("myGrid","Grid")
with thisform.myGrid
	.Height = this.Top - 10
	.width = thisform.width -10
	.recordsource = "customer"
	.visible = .t.
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform