CreateMemblockFromFile

Family: Memblock · 2 forms

What it does

CreateMemblockFromFile creates FromFile on a Memblock object. It takes memID (an integer) and filename (a string), and returns nothing. That is the first of 2 forms. memID is the id you are giving a memblock: every later call names it by that number.

Syntax

1
CreateMemblockFromFile(memID integer, filename string)
2
CreateMemblockFromFile(filename string) → integer

Parameters

NameTypeIn forms
memIDinteger1
filenamestringall

What each form returns

1CreateMemblockFromFile(1, "assets/data.dat")nothing
2memblockFromFile = CreateMemblockFromFile("assets/data.dat")integer

Example · generated

Form 1, you choose the id yourself

CreateMemblockFromFile(1, "assets/data.dat")DO  Sync()LOOP

Form 2, the command hands back the id

memblockFromFile = CreateMemblockFromFile("assets/data.dat")DO  Sync()LOOP

CreateMemblockFromFile is called with values of the types its signature asks for. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

43 commands in Memblock