Dummy Text Blocks (Lorem Ipsum)

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:

lorenipsum

1 Like

Is it “Lorem ipsum” or “Loren ipsum”. I think the former, but you have it both ways.

This is kind of cool, maybe I’ll incorporate it into Panorama now that you’ve done all the hard work! But instead of creating a global variable, I think you could use the cache( function, which was created for exactly this sort of application.

1 Like

You are correct, I do have it both ways and have now corrected it and reloaded the file under the new name LoremIpsum. I have also changed to use the cache function which I had completely forgotten about. Here is the revised code:

registercustomfunction “LOREMIPSUM(”,1,|||arrayrange(cache(“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. “,”_loremipsum”),1,4,". “)+”."+?

The revised file can be found at: http://unseensoft.com/download/LoremIpsum.zip

I guess I should have learned Latin before I started to use it. :thinking:

Note: I changed the file link in my original past to the new name as well.

Given that Gary is even older than I am, it’s possible that he’s casting his mind back to memories of Sophia :slight_smile:

You could always use this text:

O Sibili, se ergo,
Fortebus es inero.
O Nobili, demis trux
Si vatsinum, causan dux.

Come on Michael, no one is older than you. Although I do remember the end of the last ice age and how delighted everyone was when things finally started to melt!

Bruce, you made me look that one up only to find out it was a Latin joke about cows and ducks. Shame on you.

That shows that you do not move your lips when you read!

Very cool, Gary. This will be very handy. I’ve seen similar functions in other apps (LaTex comes to mind) but never thought about a Pan implementation. And despite a similar background in electronic publishing, where this placeholder was used routinely, I had no clue as to the source. (your buddy Cicero). Thanks for that!