Newbe Question on focus2.bas - Script Writing - CHDK Forum supplierdeeply

Newbe Question on focus2.bas

  • 2 Replies
  • 2658 Views
Newbe Question on focus2.bas
« on: 16 / March / 2015, 04:28:32 »
Advertisements
Hi,

first time post here and have a quick question about the focus2.bas script. I am pretty experienced in coding, having worked for a software house using in-house languages and extensive asp work using VBscript etc, but the following code is baffling me

:negative
  for i=s to -1
   g=6*g/(b+6)
  next i
return

what is it for, well what is the loop for? - the i variable is not being used in the calculation .....

The reason for understanding this is I want to modify the code to run in a different way, starting at a close manual focus (get_focus) and running in a predefined step out to infinity

TIA

Ian

Re: Newbe Question on focus2.bas
« Reply #1 on: 16 / March / 2015, 09:41:44 »
what is it for, well what is the loop for? - the i variable is not being used in the calculation .....
Ask yourself how the value of the variable "g" changes as the loop iterates.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Newbe Question on focus2.bas
« Reply #2 on: 16 / March / 2015, 09:49:25 »
Thanks,

I was just typing an update myself as the penny dropped earlier  :lol

I've moved on too and developed my own script from a couple of the ones published to produce a script that starts at the current close focus and runs out to infinity. The initial step size increases exponentially to cut down the number of images the further away the focal point moves from the camera.

It suits my purpose (model railway photography) at least :)

Cheers

ian

 

Related Topics