I am trying to follow the advice from an article I read in FoxPro Advisor and need some help. I am trying to create a library for my business rules (BUSINESS.VCX). The first class I want to create is PrimaryKey, a simple routine to generate a random number to serve as a primary key for any table. I created a custom class PrimaryKey with a property called PrimaryKey and a method called GenerateKey. GenerateKey is as follows:
*******
LOCAL nPrimaryKey
nPrimaryKey = INT(1000000 * RAND(-1) )
THIS.PrimaryKey = nPrimaryKey
*******
Is there a better way to handle this? If not, how do I call the class and get a return value? I just can't quite get the hang of this OOP thing . . . .
TIA.
John
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only