advent of code day 5 PowerBASIC Peer Support Community (original) (raw)
trying to write an entry for todays aoc puzzle, but cant get this part to compile...
Code:
DIM pagerule(22) AS STRING DIM pagerule2(22) AS INTEGER 'page ordering rules DATA 47|53 DATA 97|13 DATA 97|61 DATA 97|47 DATA 75|29 DATA 61|13 DATA 75|53 DATA 29|13 DATA 97|29 DATA 53|29 DATA 61|53 DATA 97|53 DATA 61|29 DATA 47|13 DATA 75|47 DATA 97|75 DATA 47|61 DATA 75|61 DATA 47|29 DATA 75|13 DATA 3|13
FOR idx=1 TO 22 READ pagerule(idx) pagerulel(idx)=VAL(LEFT$*pagerule(idx),2) ' extract left page number pageruler(idx)=VAL(RIGHT$*pagerule(idx),2) ' extract right page number NEXT idx
[
when i try to compile this I get this error:
Error 484 in C:\Users\Sabrewolf\Documents\aoc-day5.bas(1:001): Requires Procedure (Function/Method...)
Line 1: DIM pagerule(22) AS STRING​
It's been awhile since I've written any serious code in basic using data and read structures like this for arrays, and unfortunately, I don't understand what I am missing here so any insight would be welcomed.