Neuronal Nerd Posted January 9, 2009 Posted January 9, 2009 (edited) Is there a way for a calculation to determine if a particular field contains a reference to file or the actual file it self? I'm putting together a script that will do one action if it is a reference (i.e., open the file) or another if it was a stored image in the container (i.e., export that image for opening)? Edited January 9, 2009 by Guest typo
Søren Dyhr Posted January 9, 2009 Posted January 9, 2009 Thats pretty easy: Sign(PatternCount ( GetAsText ( aContainer ) ; "/" )) Which returns 1 if it's a referenced and 0 if it ain't! It might be a back slash to search for for "PatternCount" instead on a windows machine. Which then perhaps better can be obtained this way: Sign(Length(Filter("/";GetAsText ( aContainer )))) ...if the solution is x-platform'ish deployed! --sd
bcooney Posted January 10, 2009 Posted January 10, 2009 I believe all paths are OS independent, that is they are FM paths and contain only forward slashes.
Søren Dyhr Posted January 10, 2009 Posted January 10, 2009 Even the Sign( in my second suggestion is ridiculous - since I reversed the order input and filtering ... so one slash being filtered, is always one or zero. I wondered why didn't find it instead Barbara?? --sd
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now