>*======================================================================================== >* Returns a random name that is a valid variable name >* in Visual FoxPro and 20 to 64 characters long. >*======================================================================================== >Procedure GetRandomName > > Local lnLength, lcName, lnChar > > lnLength = Int(Rand()*44)+20 > lcName = GetChar("A_") > For m.lnChar = 2 to m.lnLength > lcName = m.lcName + GetChar("A_D") > EndFor > >Return m.lcName > > >*======================================================================================== >* Returns a random character. >*======================================================================================== >Procedure GetChar >LParameter tcTypes > > Local lnChar > > Do while .T. > lnChar = Int(Rand()*256) > Do case > Case IsAlpha(Chr(m.lnChar)) and "A" $ m.tcTypes > Exit > Case IsDigit(Chr(m.lnChar)) and "D" $ m.tcTypes > Exit > Case Chr(m.lnChar) == "_" and "_" $ m.tcTypes > Exit > EndCase > EndDo > >Return Chr(m.lnChar) >