Skip 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.

figuring out a script functionality here

Featured Replies


Let ( [

~isSameFIeld = "firstName" ;

[color=#ff0000][b][i]~isSameField = $$SORT.FIELD = ~field ; $$SORT.FIELD = ~field //THIS HAS ME BAFFLED?[/i][/b][/color]

];



~isSameField )



I JUST dont understand the mult-equals for all those variables?

anyone ?

-i

The equals sign "=" servers two purposes in a calculation engine. Firstly, it's a comparison test. The expression 2+2 = 4 returns 1 ( True ). 2+2 = 5 returns 0 ( False ). Secondly, within a Let() statement, it's an assignment operator. It permits you to define a variable. Let([ x = 3 ; result = x + 2 ]; result ) returns 5.

There's an error in that calculation, I'm guessing the first ~isSameField should actually be ~field. And on top of that, it's unclear what the calc is supposed to do, set the sort field variable and return if it's been changed? One thing that happening is there's a test to see if the ~field is the same as the $$SORT.FIELD = $$SORT.FIELD = ~field . The result of that test is being stored in the variable ~isSameField.

~isSameField = $$SORT.FIELD = ~field

could be made clearer by adding parens:

~isSameField = ( $$SORT.FIELD = ~field )

Let ( [

//define the local variable ~field

~field = "firstName" ;

//check to see if the global variable SORT.FIELD is the same as the local ~field

~isSameField = $$SORT.FIELD = ~field ;

//redefine the global variable SORT.FIELD

$$SORT.FIELD = ~field

];

//return the result of the test...has $$SORT.FIELD been redefined or not?

~isSameField

)

  • Author

thanks, so it works like a toggle on / off?

-i

What the equals sign or the calculation?

  • Author




Let ( [ 

~field = "firstName" ; 

~isSameField = $$SORT.FIELD = ~field ; 

$$SORT.FIELD = ~field ]; 



~isSameField )

let ~field = "firstName" => set ~field to be equal to firstName [database field name]

let ~isSameField = $$SORT.FIELD = ~field; ( set ~isSameField = global $$SORT.FIELD then it is = ~field

set $$SORT.FIELD to be same as ~field ;

return the !~isSameField variable

i hope that is what it does. the second line is a shortcut for if, or case ; no?

let ~field = "firstName" => set ~field to be equal to firstName [database field name]

Not really. "firstName" (in quotes) is a literal text string, not a reference to a field.

  • Author

Not really. "firstName" (in quotes) is a literal text string, not a reference to a field.

yes that is true - thanks again.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.