The purpose is to create a High Dynamic Range (HDR) image from a set of images taken at different flash exposures.
You can also use this script to select the best image from a set of different flash exposures.
The first image is taken without flash, the others with flash around the selected flash setting.
You can also combine an image with flash and one without flash to create one HDR image (see later).

First the script takes one image without flash. Then the script takes a number of images around the selected flash setting. So if you take 3 pictures, with flash set to center and Flash Step Size=3, it will take the first picture at -1, the second at center and the third at +1.
You can later stitch the images together with a program like Photomatix (http://www.hdrsoft.com/index.html) or select the best image.

Make sure that your batteries are fully loaded, because otherwise the delay between the different shots may not be sufficient to fully reload the flash for the next shot. So you may adjust the "sleeps" between different shots to your own needs.

Documentation/Help (save as a small FlashBracket.bas" file to your /CHDK/SCRIPTS/ folder)

Select P or C mode on your Canon A640.

Make sure that Slow Synchro is On and the flash is set to always On.

Make sure that if you press the Func Set button, the ISO item is selected, but leave the function menu!