mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 19:51:51 +09:00
basic: save will put .bas extension if one is not given
This commit is contained in:
@@ -2818,6 +2818,8 @@ bF.run = function(args) { // RUN function
|
||||
};
|
||||
bF.save = function(args) { // SAVE function
|
||||
if (args[1] === undefined) throw lang.missingOperand;
|
||||
if (!args[1].toUpperCase().endsWith(".BAS"))
|
||||
args[1] += ".bas";
|
||||
fs.open(args[1], "W");
|
||||
var sb = "";
|
||||
cmdbuf.forEach((v, i) => sb += i+" "+v+"\n");
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
10 DEFUN FAC(N)=IF N==0 THEN 1 ELSE N*FAC(N-1)
|
||||
20 K=MAP(FAC, 1 TO 10)
|
||||
30 PRINT K
|
||||
Reference in New Issue
Block a user