Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5983 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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 ?

Posted

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.

Posted

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

Posted

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

This topic is 5983 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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