Is a mod function available within Servoy
I f not any suggestions on how to implement one?
TIA
Is a mod function available within Servoy
I f not any suggestions on how to implement one?
TIA
What is a mod function? Can you describe what it is, what it does?
mod function returns the remainder of a given integer division
mod(15,4) would be 3
mod(22,7) would be 1
I was way off. I thought it was another mode like Find mode, Designer mode…
MOD is handy when you’re using the servoy_row_bgcolor to set alternating rows with a color - or you have a progress bar and you want to only update the progress bar for every 10 records of progress:
if(mod(controller.recordIndex,10) == 0)
{
//you're on a record number that is evenly divisible by 10
//update the progress bar
}
Bob[/code]
would this work???
does mod actually exists ?
I found how to do it:
15%4
22%7
Simple no?
Sorry Stephan - you’re right. I was posting “pseudo code” to illustrate.
Bob Cusick
excellent
I needed this to calculate a check-digit using the modulo 97 method
THX