July 8, 200817 yr Hi say that I have a long script with repeating steps like : Print [ number of copies = 1 ] Print [ number of copies = 2 ] ... Print [ number of copies = 100 ] Print [ number of copies = 101 ] ... Do you think that there is a way to say: Perform Script Step [ 100 ] w/o creating a loooong set of If/else ? The problem is that you can't specify dinamically the number of copies. I know that it's possible to create a table based on the number of copies needed, but print 100 record need more time than say to the printer : print 100 copies of the same record. Or there is a plugin that can get a number from a field and put it into the "number of copies" of the Print dialog ?
July 8, 200817 yr Why not do something like this (in pseudo code) to print 20 copies... Set $number = 20 Set $counter = 1 Loop Print [ 1 copy] Exit Loop If [ $number = $counter ] Set $counter = $counter + 1 End Loop I *personally* don't like this because it generates 20 print jobs, but it'll work.
July 8, 200817 yr You could reduce dramatically the number of required If[] statements, by using base-2 increments. With only 7 blocks, you can print anywhere between 1 to 127 copies: If [ Mod ( $copies ; 2 ) ] Print [ number of copies = 1 ] End If # If [ Mod ( Div ( $copies ; 2 ) ; 2 ) ] Print [ number of copies = 2 ] End If # If [ Mod ( Div ( $copies ; 4 ) ; 2 ) ] Print [ number of copies = 4 ] End If # If [ Mod ( Div ( $copies ; 8 ) ; 2 ) ] Print [ number of copies = 8 ] End If # If [ Mod ( Div ( $copies ; 16 ) ; 2 ) ] Print [ number of copies = 16 ] End If # If [ Mod ( Div ( $copies ; 32 ) ; 2 ) ] Print [ number of copies = 32 ] End If # If [ Mod ( Div ( $copies ; 64 ) ; 2 ) ] Print [ number of copies = 64 ] End If
July 8, 200817 yr Author Many thanks to both. comment, that's a nice idea, I'll work on it. BTW: this is another thing to put into next versions of FileMaker
Create an account or sign in to comment