'Welcome to the Commodore Computer Wiki!'

COLLECT

Keyword Token Version Category(s)
COLLECT $D1 4.0, 4.7 Command and Statment
COLLECT $F3 3.5, 7.0+ Command and Statment

Syntax

COLLECT [parameter [,parameter]…]

Where parameter may be one of:

  • D drive (drive number of disk, default 0)
  • U unit (unit number of disk, default 8)
  • R (read mode, default/redundant)
  • I id (one or two character disk ID, ignored/bug)

Purpose

Rebuild the disk BAM by scanning all properly closed files and remove any “splat” files from the disk.

Notes

Parameter(s) must be surrounded by parentheses if a variable or expression is used.

This is normally only used when it is suspected/known that disk directory or BAM has been corrupted (often by removing a disk or resetting the computer or drive when a file is open for writting).

Caution should be used because blocks reserved by special software (blocks not associated with a file in the directory) will be marked “free” and can thus be overwritten by subsequent disk writes. Examples include any GEOS-formatted disk or a disk with a C128 boot sector.

The R and U parameters may be repeated an unlimited number of times. Only the final U parameter (if any) will be used.

For some reason, the U parameter allows the use of ON in place of a preceding comma.

This same command is referred to as Validate in Commodore disk drive literature.

Examples

COLLECT :REM unit 8, drive 0
COLLECT U9 :REM unit 9, drive 0
COLLECT D(D) ON U(U) :REM unit U, drive D (variables)
COLLECT IONS :REM same as first example (obfuscation)

Older versions of BASIC may use something like

OPEN 8,8,15,"V0:" :CLOSE 8

This page is a member of Commodore BASIC and Disk Commands