Before I get into the update, let me talk a bit about the conditions..
The past weeks have been rough here in the Arizona desert. We're powered by solar and generator. A few 100 watt panels, 2k watt generator, and three Jackery power stations. I put in a window AC for the first time after living off grid for almost 8 years. It barely keeps up. Not even worth running when over 100 degrees, so we just run swamp coolers during the day and the AC for a few hours at night.
Managing the homestead and showing up to work on time while trying to keep the mind sharp with coding takes a toll when you're sitting in well.. it is 109 in my trailer as I type this and my poor 2001 Dell Inspiron 1150 with Windows XP is nearly ablaze with fire.
Doesn't help that we're struggling in general. My job barely gets us by. Hand washing clothes or going to a laundry place. Hauling our own water. Pumping said water to tower and various tanks. Taking care of our plants and animals. Time is precious and goes too fast.
That's enough about that. Here's what we have to present with the update! Be warned. This is a bleeding edge update, although they really all have been.
The update includes:
1. SPACE$() function as an alias for TAB() to help with portability of BASIC code
2. Bitwise operators BAND, BOR, and BNOT(). XOR was already bitwise
3. HEX$() and OCT$() functions
4. Error #13 Unable to open file stream
5. Major issue with the string array not having headers fixed
6. Relational operators < > <= >= now work with strings along with = and <>
7. Whitespacing with tabs using space and colon after line number
We were planning on adding INKEY, but ran into trouble with Linux and haven't found a solution yet. Rather than waiting, we're pushing out the update without INKEY. It is working fine for DOS, DPMI, and Windows. The implementation is based on TSR BASIC (not TRS).
INKEY will look like this when we implement it on a future update.
10 PRINT "Enter key, or q to stop";
20 key = INKEY(1)
30 scancode = key SHR 8
40 charcode = key BAND &HFF
50 PRINT
60 PRINT "scan code = "; scancode
70 PRINT "char code = "; charcode;
80 PRINT " ("; CHR$(charcode); ")"
90 IF UCASE$(CHR$(charcode)) <> "Q" THEN 20
Again, this update will not include the INKEY function.
New examples:
Code: Select all
1 REM BUBBLE SORT
2 REM BEGINNER'S BASIC BY PETER LEAR
3 REM MODIFIED TO RUN ON EXPRESS BASIC
5 CLS
10 INPUT "NUMBER OF WORDS TO SORT"; N
20 PRINT "ENTER WORDS:"
30 FOR I = 1 TO N
40 INPUT $(I)
50 NEXT I
60 PRINT "NOW SORTING...PLEASE WAIT"
70 PRINT
80 FOR I = 1 TO N - 1
90 FOR J = I + 1 TO N
100 IF $(I) < $(J) THEN 150
110 DU$ = $(J)
120 $(J) = $(I)
130 $(I) = DU$
150 NEXT J
160 NEXT I
170 FOR I = 1 TO N
180 PRINT $(I)
190 NEXT I
Code: Select all
1 REM https://rosettacode.org/wiki/Floyd's_triangle
100 INPUT "Number of rows (1-20): "; rows
110 FOR col = 1 TO rows
120 : @(col) = LEN(STR$(col + rows * (rows - 1) / 2))
130 NEXT col
140 thisnum = 1
150 FOR r = 1 TO rows
160 : FOR col = 1 TO r
170 : PRINT RIGHT$(" " + STR$(thisnum), @(col)); " ";
180 : thisnum = thisnum + 1
190 : NEXT col
200 : PRINT
210 NEXT r
Code: Select all
1 REM https://rosettacode.org/wiki/Bioinformatics/base_count
100 INPUT "DNA file (*.txt): ", file$: OPEN "I", #1, file$
110 PRINT : PRINT "SEQUENCE: "
120 IF EOF(1) THEN PRINT "no data in file": END
130 INPUT #1, b$: GOSUB 1000: IF EOF(1) = 0 THEN 130
140 PRINT: PRINT
150 PRINT "Count: A = "; acnt; " C = "; ccnt; " G = "; gcnt; " T = "; tcnt
160 END
1000 IF b$ = "" THEN RETURN
1010 FOR i = 1 TO LEN(b$)
1020 : IF n MOD 30 = 0 THEN PRINT: PRINT RIGHT$(" " + STR$(n + 1), 5) + ": ";
1030 : IF n MOD 5 = 0 THEN PRINT " ";
1040 : m$ = MID$(b$, i, 1)
1050 : PRINT m$;
1060 : IF m$ = "A" THEN acnt = acnt + 1: GOTO 1110
1070 : IF m$ = "C" THEN ccnt = ccnt + 1: GOTO 1110
1080 : IF m$ = "G" THEN gcnt = gcnt + 1: GOTO 1110
1090 : IF m$ = "T" THEN tcnt = tcnt + 1: GOTO 1110
1100 : PRINT "error at "; n, m$
1110 : n = n + 1
1120 NEXT i
1130 RETURN