Unique Name Creation

I had an issue where I needed to be able to create a unique customer name. It had to be "real", inasmuch as it must start with a capital (I know that some names don't but mostly they do) and it must not contain digits. This is the (rather basic) code I came up with. It does work, hence I thought I would share it. It does not give hyphens or apostrophes (so no O'Connor or Smythe-Thompson). Maybe someone will re-write it properly! I place it in globals.h.

==================================================

void unique_name(void){ /* This routine creates a string that changes every 1000th of a second. It should give a unique string when used in a script as it is unlikely that 2 scripts will call it at the same time. I use this to create a surname that is unique to a system. The Forename is simply a substring of the surname, and Forename2 (in case you need a married couple) is a substring of Forename. The resultant string is created in 2 parts, as the date string is rather long. Also, if the full string is used, the year would be evaluated first, which would mean that all surnames in a test would start with the same letter - starting with the "time" portion helps this. This is a rather crude implementation and needs the following LoadRunner parameters creating: pTimeStr and save the format %M%S.000 pDateStr and save the format %Y%m%d%H These are the output parameters: fSurname fForename fForename2 I like to create these as LoadRunner "VuserID" parameters - this way they are highlighted in the code - the vuserID is created at the test start so is safely overwritten when this function is run. This was a quick fix rather than have the function return values. My C skills are legendary but for all the wrong reasons! There is a neater way to do this but I've not progressed it.*/ extern double pow(double x,double y); extern long strtol(const char *s, char **end_ptr, int base); extern double strtod(const char * str, char ** endptr);

We are currently working on an HP site to allow assets uploading and sharing. In future versions VuGen will be linked directly to this repository, allowing a quick search, upload and download of materials.

If you have additional sources to share or known contributors, please post below. I will contact them once the site will be public.