FileMaker code snippet giveaway - TweetWare!

Here's another FileMaker code snippet giveaway.

When creating a new database, it's good to populate it as soon as possible during the build with some data that's roughly like what will end up in the system when it's in use. This helps with all sorts of issues, such as layouts, debugging, testing and so forth.

However, real data isn't often forthcoming when you want it, so you need to create dummy data, quickly. That's just what the code here does: it creates a list, in this case, consisting of Project Title, Project Descriptions and Project Start and Project End dates.

Paste it into your FileMaker data viewer and click refresh. We use it, or variant of it, in an autoenter in a table of empty records all the time.

This code snippet is TweetWare: that is, if you like it, Tweet it: #filemaker @igeekUK

Download it here or copy and paste from below.



// feeder text
§Text =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum scelerisque at mauris ac dapibus. Morbi gravida risus nec risus commodo, sit amet convallis massa aliquet. Maecenas eleifend tortor in ex dictum pharetra. Quisque auctor lacinia gravida. Donec eget gravida felis, at dictum urna. Pellentesque lobortis metus auctor mi euismod, sit amet gravida sem sodales. Curabitur aliquet pulvinar felis, nec tristique purus mattis sit amet. Suspendisse potenti. Praesent accumsan fermentum velit et sollicitudin. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean ut ligula sed nibh finibus ullamcorper. Vivamus non tellus at est porttitor condimentum. Donec at turpis egestas, fringilla eros at, tempus odio.

Maecenas justo mauris, feugiat facilisis eleifend sed, molestie ut purus. Vestibulum blandit lacus tempus erat mattis elementum. Mauris a risus sit amet quam commodo tempus. Donec ultrices a felis quis eleifend. In ut commodo massa. Quisque ut porta velit. Maecenas est sem, egestas eget felis vel, ultrices luctus ante. Donec in scelerisque risus. Nam velit ex, ultrices ut nisi quis, gravida sollicitudin urna. Ut ac tellus sapien.

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Morbi gravida vulputate tortor, eu sagittis nulla iaculis in. In eros tellus, facilisis quis pellentesque nec, bibendum ac ex. Aliquam vel lorem non libero commodo facilisis eget sit amet massa. Proin porta orci in erat porttitor, non pulvinar mi scelerisque. Duis sodales libero sed condimentum ultricies. In pellentesque tortor vitae urna porta feugiat.

Maecenas quis ultricies elit, quis semper odio. Sed pretium, leo ut gravida aliquet, diam lacus rhoncus nisi, dapibus rhoncus ex risus id mi. Cras sagittis tellus eget nisl cursus convallis. Mauris volutpat magna varius est rhoncus, nec gravida tortor scelerisque. Nullam eu ligula quis justo malesuada ultrices. Aliquam dapibus lobortis magna, nec iaculis nisi viverra ornare. Nullam vitae vestibulum ligula, in tempor velit. Mauris risus purus, vestibulum id nisl sit amet, vulputate consectetur est. Aenean non vulputate leo.

Morbi mollis ante eros, sed accumsan nunc viverra non. Aenean fermentum, urna in lobortis gravida, arcu massa semper ipsum, auctor sodales leo elit ut diam. In hac habitasse platea dictumst. Pellentesque id justo fermentum, feugiat orci at, malesuada arcu. Sed elementum felis sed dolor varius vestibulum. Etiam vulputate elit dolor, at rhoncus dui gravida non. Aliquam ac sapien at diam feugiat aliquam. Cras rutrum quam ut diam blandit, eu rhoncus elit condimentum. Cras blandit ex sem, eget condimentum arcu efficitur ac. Donec tristique sit amet eros quis tempus.

Curabitur ut felis ac leo tempus vehicula sed et arcu. Vivamus ipsum diam, gravida vel erat ac, sodales pellentesque augue. Proin laoreet consequat erat rutrum tempor. Ut pretium massa a pharetra dictum. Nullam sodales massa velit, porttitor accumsan diam fermentum quis. Integer ornare purus et lacus fringilla, vel facilisis leo placerat. Suspendisse blandit massa luctus semper tempus.

Ut imperdiet metus interdum lacinia malesuada. Suspendisse potenti. Nulla ac bibendum lacus. Mauris sit amet urna id nulla viverra volutpat vel non neque. Mauris a libero aliquam, dictum sem eu, pretium ipsum. Vivamus id diam placerat.";

// short text — 6 words
§Start = Floor( Random * 494 ) + 1 ;
§RawPick = Substitute( MiddleWords ( §Text ; §Start ; 5 ) ; "." ; "" );

// Make first letter uppercase
§LengthText = Length( §RawPick );
§Title = Upper( Left( §RawPick ; 1 ) ) & Right( §RawPick ; §LengthText - 1 ) ;

// long text — 60 words
§Start = Floor( Random * 440 ) + 1 ;
§RawPick = MiddleWords ( §Text ; §Start ; 50 ) ;

// Make the first letter upper case and the last character a full stop.
§LengthText = Length( §RawPick );
§Description = Upper( Left( §RawPick ; 1 ) ) & Right( §RawPick ; §LengthText - 1 ) & ".";

/* select a UUID from a global UUID list
§Length = ValueCount( $$a01_Organisations ) ;
§Pick = Floor( Random * §Length ) + 1 ;
§UUID = GetValue( $$a01_Organisations ; §Pick ) ;

// two dates
§StartDate = Date( 1 ; 1 ; 2013 ) ;
§EndDate = get(currentdate) ;
§Difference = §EndDate - §StartDate ;

§Add = Floor( Random * ( §Difference + 1 ) ) ;
§Date1 = §StartDate + §Add ;
§Date2 = §Date1 + floor( random * 120 ) ;

result =
§Date1 &¶& §Date2 &¶& §Title &¶& §Description



Make a comment

This is a captcha-picture. It is used to prevent mass-access by robots. (see:

Note: All comments are moderated and will appear as soon as they are approved.