This Technical Note explains how an application can tell when a user chooses Cancel from an EraseDisk or Format dialog box and explains why thefile_sys_ID field is ignored in class-zero calls.
Changes since July 1990: Noted that System Software 5.0.3 fixes some of these anomalies.
GS/OS Reference says that EraseDisk and Format return with the carry flag set and A equal to zero when the user cancels the operation. This is great, except that the calls actually return with the carry clear, making a Cancel hard to distinguish from a successful EraseDisk or Format operation. This happens in System Software 5.0.2 and earlier; it works as documented in GS/OS Reference in System Software 5.0.3 and later.
If you must use 5.0.2 or earlier versions of the system software, this Note presents a safe way around the problem, which works with all versions of the System Software:
Note that this method only works for class-one calls. For the class-zero ERASE_DISK and FORMAT calls, the file_sys_ID word is only an input parameter and always remains unchanged.
Even though fileSysID is an input parameter for the class-zero calls ERASE_DISK and FORMAT, all versions of the system software ignore thesupplied value and always give the user a dialog for selecting a file system. This means no functionality is lost by putting a zero there.
The reasons for this decision are historical. Although the Apple IIgs ProDOS 16 Reference indicates that the input parameter file_sys_ID would be used in future versions to choose destination file systems, ProDOS 16 always returned an error if the file system specified was not $0001 (ProDOS).
Since this effectively means no ERASE_DISK or FORMAT call can be made under ProDOS 16 with any file_Sys_ID other than $0001, the GS/OS team chose to ignore the parameter and always give users the choice when using class zero calls. Otherwise, no program that existed when GS/OS was released would ever allow users to choose interleaves or file systems (they would always format for ProDOS, file system $0001). (Note that the class-one Format andEraseDisk calls have a new reqFileSysID parameter; if this field is present, the dialog box is bypassed.)
This and all of the other Apple II Technical Notes have been converted to HTML by Aaron Heiss as a public service to the Apple II community, with permission by Apple Computer, Inc. Any and all trademarks, registered and otherwise, are properties of their owners.