IsValidIsValid( "BruceWillisBaldness" )Posted by: aflgenx / Sunday, August 19, 2007 – 4:32am
So I haven't blogged in the while - been busy with something i'll tell "you's all" about later. As I was sitting there I thought, what better reason to blog than to try and reason out why Bruce Willis is as bald as he is. Well, I was going to but thought Matt might get upset... so instead this post will breifly discuss data types and how the IsValid() function mixes it all up (a bit of a let down i know :p ). The thought to write about this came from an auto update plugin ... article type thing... at Six Fried Rice recently - love these guys and somehow, they get their posts to flow in more of a straight line than mine. Anywho, it's a bit of a weird function and while it may be obvious to some, its workings can often escape logical reasoning for no logical reason. Now, the purpose of IsValid() is to determine whether the contents of a data container (i.e. a field or variable) match the data container's data type. With fields this is farily obvious: How It Works with different Data Types: Now with fields where the data type is already defined, it really has little use in most cases, so when do you use it? One potential place is scripts. Think date inputs into a custom dialog, you don't want to manually have to validate this sort of stuff or worse yet let it slip past: IsValid( GetAsDate( input ) ) is your functional statement (*note to self: don't make up terms*). GetAsDate( input ) immediately tells IsValid() that you are checking for the validity of the contents of the input field using the date data type - IsValid( GetAsDate( "17/17" ) ) for example, returns false. Now - here's where a lot of people slip up, data type conversion can happen relatively unoticeably in various places in FileMaker. The most common form though is concatenation - concatenate something and it immediately becomes a string.. i.e. text data type. An interesting note about variables: An interesting note about Script Parameters: PS. Die Hard 4 = Awesome!! By the way, feel free to leave comments if you want... seriously it'd be good to know if anyone's benefiting at all from my ramblings or how bad my speeling is ;) . |
Be Notified!Let us tell you when a new video is posted. We'll send you an email with a direct link right to your email inbox.
Make sure and whitelist (or add to your address book editor@filemakermagazine.comFileMaker Reference Tool
* $29.99 is the FMPug member price for a printed copy. 10 Most Recent Videos
|