Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyone out there using AFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00285980
Message ID:
00288559
Vues:
9
Hi Bob,

>Well, I don't use AFP, and perhaps I am wrong about this but. Just becuase you use AFP doesn't mean you have to put your business logic into the AFP. Can't you build PRG or VCX based business objects which your AFP's talk to. Even better, since you are in the VFP environment, you wouldn't even have to use COM, you can just instantiate the class directly?

Yep. Using AFP and FoxPro is just as using ASP and VB Script. You place code into an HTML document of some type and in there you can do anything you want in VFP code. IOW, AFP offers for a VFP web application, what an SCX is in a plain VFP application. It defines data input and output, but doesn't say anything about how data is processed. For example, the following code would work in VFP and inside AFP:
oCustomer = CreateObject( "bizCustomer" )
oCustomer.First()
Do While not oCustomer.IsLast()
   oCustomer.LoadCurrent()
   ? oCustomer.Name, oCustomer.CreditLimit
   oCustomer.Next()
Enddo
In VFP, this would print a list of customers and their credit limit on the screen, in AFP this would insert the result into the HTML page and displays it there.

I haven't yet worked with AFP, so I'm not sure whether you need to add any line separation tag, or so. But I can't see where I mix business logic and the user interface layer here, all data retrival and processing is done by the bizCustomer object. Of course, you can write the above example with USE and a SCAN loop, or even a BROWSE. This possibility works in AFP, too, and of course mixes data processing and data presentation. But you don't have to code it like this.

And before anyone asks *s*, yes, I work with ProLib.

Christof
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform