Noél Dubau Posted November 25, 2010 Posted November 25, 2010 Hello, Suppose a scriptmaster with in entry two fields of a FileMaker database. I want to do some actions only if both of thesse fields are not empty. I'm at level 0 and don't find the correct syntax to use : if field1 and field2 are not empty my command endif Thanks for the helper ! Noêl
bcooney Posted November 25, 2010 Posted November 25, 2010 If not isempty (field1) and not isempty ( field2) my command end if
Noél Dubau Posted November 25, 2010 Author Posted November 25, 2010 hello, Thanks for your proposition. I did but a first error was found and I did what I thought asked to do : place not in brackets... But a second error occurs and I don't understand I join two screen copies. Noël (hope you'll not laugh too much !) Archive.zip
bcooney Posted November 25, 2010 Posted November 25, 2010 Sorry, I didn't realize that you were asking about Scriptmaster code. I thought that you were asking how to conditionally run a command, outside of the scriptmaster code.
john renfrew Posted November 25, 2010 Posted November 25, 2010 If ( field1 != null && field2 != null ) { do somethinng }
Noél Dubau Posted November 25, 2010 Author Posted November 25, 2010 Hello John ! Thanks for that answer. My question is linked to another mail I posted here ( http://fmforums.com/forum/showtopic.php?tid/217817/). I saw that if I wanted to pass through a proxy I had to include these line in my script Properties props = System.getProperties() props.put("http.proxyHost", proxyname) props.put("http.proxyPort", proxyport) It seems running if proxyname (here I had in fact IP of the proxy) and proxyport of the database are not empty . After your answer I tried this : // declaration proxy If ( proxyname != null && proxyname != null ) { Properties props = System.getProperties() props.put("http.proxyHost", proxyname) props.put("http.proxyPort", proxyport) } but error, error... horror ! Can you help me more ? Thanks Noël
john renfrew Posted November 26, 2010 Posted November 26, 2010 This bit works... so the error might be somewhere else. This will return the value you put into the port which demonstrates it works, or false if one of the values has nothing in it Looks like the 'error' is somewhere else.... if( proxyname != null && proxyport != null ){ props = System.getProperties() props.put("http.proxyHost", proxyname ) props.put("http.proxyPort", proxyport ) return System.getProperty("http.proxyPort") } else { return false }
Noél Dubau Posted November 26, 2010 Author Posted November 26, 2010 Thanks ! That second sample runs fine ! Have a good day ! Noël
john renfrew Posted November 27, 2010 Posted November 27, 2010 Only just look properly... You had the same variable test twice on the first line, which mean if proxyport was empty it would throw an error If ( proxyname != null && proxyname != null )
Noél Dubau Posted November 27, 2010 Author Posted November 27, 2010 Yes, I saw the repetition for the same condition ! Thanks one more time. Noël
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