Generating Random "Fake Latin" Strings, Part 2
By Dave Cantrell
In Part 1 we looked at the
GetLatinSentence function, which generated fake Latin sentences. In this part we'll look at
the function GetLatinParas, which generates fake Latin paragraphs!
GetLatinParas()
This function simplifies using the GetLatinSentence() function. As with GetLatinSentence(), we declare the function
and localize the inputs:
|
We also have a series of variables we should go ahead and set up now:
|
Now we start the loop. In here we (1) randomly determine the number of sentences in this paragraph, (2) build
each sentence using GetLatinSentence, and (3) concatenate the result onto strResult.
I set the paragraph length here to a minimum of three and maximum of seven sentences.
|
Finally, return the string to the caller and close:
|
There is a live demo available which allows the user to select a variable number of fake Latin paragraphs to be generated. If you're curious as to the output, go ahead and give the demo a run!
Anyways, hopefully these functions will help you out next time you need demo text in a hurry. It sure would have helped me! :D
Ciao!
-dave
Attachments:
latin.asp in text format




