Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Syntax to test if a parameter is not empty

Featured Replies

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

If not isempty (field1) and not isempty ( field2)

my command

end if

  • Author

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

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.

If ( field1 != null  && field2 != null ) {

do somethinng

}

  • Author

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

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

}

  • Author

Thanks ! That second sample runs fine !

Have a good day !

Noël

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 ) 

  • Author

Yes, I saw the repetition for the same condition !

Thanks one more time.

Noël

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.