Photography

This file is part of Timex Sinclair Public Domain Library Tape 1002 . Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 1000

{This program calculates the correct f-stop aperture setting for flash photography using the guide number method. It prompts the user to enter the film/flash guide number and the flash-to-subject distance in feet, then divides the guide number by the distance to produce the required f-stop (F = G/D). After displaying the result, pressing any key clears the screen and restarts the calculation loop, allowing repeated use without reloading. The program structure is minimal and linear, making it a practical pocket-reference tool for photographers.


Program Analysis

Program Structure

The program is a tight, single-loop utility. Lines 10–100 handle input, calculation, and output; line 110 waits for a keypress; lines 120–130 clear the screen and restart. The flow is entirely linear with no subroutines.

  1. Lines 10–20: Title and decorative heading.
  2. Lines 30–80: Input prompts and echo for guide number (G) and distance (D).
  3. Line 90: Core calculation: LET F=G/D.
  4. Line 100: Displays the recommended aperture.
  5. Line 110: Busy-wait keypress loop using INKEY$.
  6. Lines 120–130: Clear screen and loop back to start.

The Flash Guide Number Formula

The guide number (GN) method is a standard photographic relationship: f-stop = GN / distance. The program implements this directly at line 90. No unit conversion is performed; the prompt at line 60 specifies feet, so the result is only correct when the guide number is rated for feet rather than metres.

Key BASIC Idioms

  • Keypress wait (line 110): IF INKEY$="" THEN GOTO 110 is a standard busy-wait loop, holding the result on screen until the user presses any key before cycling back.
  • Input echo (lines 50, 80): After each INPUT, the entered value is immediately PRINTed back, confirming what was typed — a common pattern to provide visual feedback.
  • Restart via GOTO 10 (line 130): Rather than using RUN (which would re-initialise variables), GOTO 10 re-enters the display/input sequence while preserving any variable state, though in this case all variables are re-assigned on each pass anyway.

Notable Anomalies

  • Line numbering gap: Lines jump from 130 to 150, skipping 140. This is cosmetically unusual but functionally harmless.
  • Line 200 (RUN): A RUN statement stored as a program line is never reached during normal execution; it exists as a convenience for manually typed execution or as a remnant of editing.
  • No input validation: If the user enters 0 for distance D, line 90 will produce a division-by-zero error. A guard such as IF D=0 THEN GOTO 60 would make the program more robust.
  • Result not rounded: F is printed as a raw floating-point value (e.g., F/6.666...), which may not map cleanly to standard f-stop markings (f/2, f/2.8, f/4, etc.). A rounding or lookup step would improve practical usability.

Variable Summary

VariablePurpose
GFlash guide number (user input)
DFlash-to-subject distance in feet (user input)
FCalculated f-stop aperture (G/D)

Content

Appears On

Assembled by Tim Ward from many sources. Contains programs 10051 – 10121.

Related Products

Related Articles

Related Content

Image Gallery

Photography

Source Code

   5 REM PHOTOGRAPHY
  10 PRINT "FLASH EXPOSURE"
  20 PRINT "**************"
  30 PRINT "FILM GUIDE NUMBER: ";
  40 INPUT G
  50 PRINT G
  60 PRINT "FLASH/SUBJECT DISTANCE: ";
  70 INPUT D
  80 PRINT D;" FEET"
  90 LET F=G/D
 100 PRINT "SHOOT AT F/";F
 110 IF INKEY$="" THEN GOTO 110
 120 CLS 
 130 GOTO 10
 150 SAVE "1005%6"
 200 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top