Skip to content

Tokenizer manipulates leading and padding zeros on decimal numbers #49

Description

@beheybird

In Applesoft you can drop the leading zero or add zeros to a decimal number and it will store this as typed. It does not affect the value or operations on that variable by math functions. The output will be the same but the source listing is modified by bastools.

Why would anyone care? Typing in Applesoft programs from a magazine such as Nibble and verifying with a checksum tool such as KeyPerfect will give incorrect values. If possible, it would be nice if what you type is what you get in the conversion tool. I already hit this on the second program I tried because there is no fixed rule for entering numbers in Applesoft.

Example:

APPLESOFT (VALID CODE, SHOWN USING LIST)
10 PRINT "MATHING"
30 A = .4
40 B = 0.6000
50 C = -.250
60 D = -0.70
70 PRINT "A=";A
80 PRINT "B=";B
90 PRINT "C=";C
95 PRINT "D=";D

TOKENIZER
10 PRINT "MATHING"
30 A = 0.4
40 B = 0.6
50 C = - 0.25
60 D = - 0.7
70 PRINT "A=";A
80 PRINT "B=";B
90 PRINT "C=";C
95 PRINT "D=";D

SAME OUTPUT:
A=.4
B=.6
C=-.25
D=-.7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions