Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADDOBJECT
Message
De
16/09/1999 05:38:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
15/09/1999 12:54:46
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00264974
Message ID:
00265363
Vues:
19
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform