limbo wrote:Smart thought by a Smartie user
Keep On
Thank you, limbo.
As it turns out, my father become a little bored with the same 60 phrases repeated sequentially, and hinted that he?ll love to have something more random -- but with his 9000+ collection.
So I needed a plugin that outputs a random number within such range. I didn?t find one, and realized that could be a great opportunity to discover what Delphi is.
I downloaded Delphi 7 Personal ( still free, thanks Borland ) yesterday, read the help files, used the demo.dll source as a guide, wrote a very simple dll, compiled the thing and it amazingly worked.
Maybe it could be of use for someone else. It?s here:
http://www.aldreis.com/recursos/smartie/rando.zip ( 24KB )
Syntax:
$dll(rando,1,X,Y)
It returns a random integer from the range that extends between X ( inclusive ) and Y (inclusive).
Examples:
$dll(rando,1,0,3) > a random number between 0 and 3.
$dll(rando,1,100,200) > an one between 100 and 200.
-----------
And that ?One Minute Wisdom? screen became this:
Code: Select all
$File(phrases.txt,$dll(rando,1,1,9000))
NOW he?s happy.
