Type Mismatch
Sharp Sharp MZ
Severity: MinorWhat Does This Error Mean?
Type Mismatch on the Sharp MZ means BASIC encountered a string where a number was expected, or vice versa. The Sharp MZ has no built-in BASIC — the error format depends on which BASIC you loaded from tape or disk. Check the variable types on the reported line.
Affected Models
- Sharp MZ-80B
- Sharp MZ-80K
- Sharp MZ-700
- Sharp MZ-800
- Sharp MZ-1500
Common Causes
- Assigning a string to a numeric variable without the $ suffix
- Passing a string to a numeric function (SQR, SIN, LOG)
- Reading DATA of the wrong type
- Using a string in an arithmetic expression
How to Fix It
-
List the program and go to the line shown in the error.
In most Sharp MZ BASICs, LIST displays the program. The error message includes the line number where the type conflict was detected.
-
Check variable naming conventions for your BASIC.
In SP-8002 BASIC and HuBASIC, string variables typically end with $ (e.g. A$). Numeric variables have no suffix (e.g. A). A = "HELLO" causes Type Mismatch — use A$ = "HELLO" instead.
-
Check any function calls for the correct argument type.
Mathematical functions require numeric arguments. String functions require string arguments. Using the wrong type in either direction causes Type Mismatch.
-
Check READ/DATA statements.
A DATA line containing mixed types (DATA HELLO,10) must be READ with matching variable types (READ A$,B). Mismatch between DATA values and READ variable types is a common cause.
Frequently Asked Questions
Why does the Sharp MZ not have built-in BASIC?
The Sharp MZ series was designed as 'clean computers' — all software including BASIC was loaded from tape or disk. This made the MZ flexible but meant different BASIC versions had slightly different error messages.
Which BASIC was most commonly used on the Sharp MZ?
The Sharp MZ-80B used SP-8002 BASIC from Sharp. The MZ-700 and MZ-800 commonly ran HuBASIC by Hudson Soft, which was similar to Microsoft BASIC. MZ-800 owners also had access to MZ-BASIC.