There are occasions when it is handy to have a block of sample text available to propagate a Text Display Object, Text Editor Object or Browser Object as I’m building a new form. The common method since the 1500’s is to use blocks of Latin text stripped from Cicero’s “de Finibus Bonorum et Malorum” written in 45 BC. This text starts with the familiar “Loren ipsum” and is used so that recognizable text does not distract viewers attension from the other design elements of the layout.
With this in mind I worked up a custom function that will generate this dummy text as needed. There is one parameter for the number of paragraph blocks requested. The function will first generate the common first block of loren ipsum Latin text (the first 4 sentences) and then, depending on the number of paragraphs indicated, it will create additional paragraphs made up of a random number of random sentences (between 1 and 5) picked from the remaining text. The limitations are that you can not predetermine exactly how long the entire text will be and you may have some duplication of the blocks beyond the second paragraph. And one final thing is that this also creates a new global variable called _lorenipsum which contains all the raw Latin text.
I have the custom function code contained in the .InitializeFunctions procedure of a file named LorenIpsum available here: http://unseensoft.com/download/LoremIpsum.zip
Here is the code for the function I have named lorenipsum(:
/*
LORENIPSUM(count)
generates the standard dummy Latin text paragraphs
count – the number of paragraphs to create.
*/
registercustomfunction “LORENIPSUM(”,1,|||arrayrange(assignglobal(“Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. “,”_lorenipsum”),1,4,“. “)+”.”+?(•1=1,“”,arraystrip(replace(arrayfilter(" “+rep(chr(1),•1-2),chr(1),{¶+¶+arrayrange(arrayrandomize(arrayrange(_lorenipsum[1,-2],2,-1,”. “),”. “),1,randominteger(1,5),”. “)+”.“}),¶+¶+”. “,¶+¶),”.“)+”.")|||
Here is a simple animation showing how it can be used in a Text Display Object: