Skip to main content
Commonmark migration
Source Link

##QBIC, 70 bytes

QBIC, 70 bytes

open"r",1,"a.b" $get#1,1,e|~e=0|e=z\e=e-1]?e~e=0|$error 1|]$put#1,1,e| 

Opens file a.b (or creates it when not found on first run), reads record 1 into e. If that record is not found, assume 10, else sub 1. At e==0, raise an error. Write back e to a.b.

File access is not built into QBIC, this relies heavily on the underlying QBasic.

##QBIC, 70 bytes

open"r",1,"a.b" $get#1,1,e|~e=0|e=z\e=e-1]?e~e=0|$error 1|]$put#1,1,e| 

Opens file a.b (or creates it when not found on first run), reads record 1 into e. If that record is not found, assume 10, else sub 1. At e==0, raise an error. Write back e to a.b.

File access is not built into QBIC, this relies heavily on the underlying QBasic.

QBIC, 70 bytes

open"r",1,"a.b" $get#1,1,e|~e=0|e=z\e=e-1]?e~e=0|$error 1|]$put#1,1,e| 

Opens file a.b (or creates it when not found on first run), reads record 1 into e. If that record is not found, assume 10, else sub 1. At e==0, raise an error. Write back e to a.b.

File access is not built into QBIC, this relies heavily on the underlying QBasic.

Source Link
steenbergh
  • 8.2k
  • 1
  • 27
  • 43

##QBIC, 70 bytes

open"r",1,"a.b" $get#1,1,e|~e=0|e=z\e=e-1]?e~e=0|$error 1|]$put#1,1,e| 

Opens file a.b (or creates it when not found on first run), reads record 1 into e. If that record is not found, assume 10, else sub 1. At e==0, raise an error. Write back e to a.b.

File access is not built into QBIC, this relies heavily on the underlying QBasic.