[SOLVED] loadBytes implemented yet?

Just tried using loadBytes() but the console (Edge) says it hasn’t been implemented, and the p5.js file says similar:

0: not yet implemented

p5.prototype.loadBytes = function () {
// TODO
throw ‘not yet implemented’;
};

Is it likely this will be working soon …?

Cheers
Mark

1 Like

is there a version problem?

https://p5js.org/reference/#/p5/loadBytes

https://editor.p5js.org/kll/sketches/6K8eiteaU
use

/*! p5.js v0.9.0 July 01, 2019 */

run on Win10 / Firefox & Edge

let mytext;

function preload() {
  mytext = loadBytes('assets/myfile.txt');
}

function setup() {
  createCanvas(400, 400);
  //for (let i = 0; i < 5; i++) console.log( char(mytext.bytes[i]) );
}

function draw() {
  background(200,200,0);
  for (let i = 0; i < 5; i++) 
    text( char(mytext.bytes[i]) ,20+i*20,20);
}

2 Likes

Maybe … I’ll check that now …

@kll That was the problem … a slightly old version of p5.js …

Many thanks

2 Likes