Connecting a variable to a command such as clg(enter)circle (Language Help)

by Milo, Monday, January 24, 2011, 14:48 (2317 days ago)

While doing tutorial 10, and writing:

clg
color blue
circle 20,20,8
clg
circle 30,20,8
clg
circle 40,20,8
clg
circle 50,20,8
clg
circle 60,20,8

I was wondering, can I connect a variable ('a') to a command, such as:

clg
circle

So that I could simply write:

color blue
a=clg circle
a 20,20,8
a 30,20,8
a 40,20,8
a 50,20,8
a 60,20,8

?


I've been wanting to learn to program for a long time now, but never knew where to start, this is my first real encounter with programming, other than some python basics 2 years ago.

Connecting a variable to a command such as clg(enter)circle

by Jim ⌂ @, Russell, KY, Monday, January 24, 2011, 19:01 (2317 days ago) @ Milo

What you are describing is the creation of subroutines and functions and that language extension is not supported, yet. Variables are stored in a hash and contain numbers, strings, or arrays of numbers and strings used by the program when it is running. The actual tokens (reserved words) of the language are used by the compiler to figure out what the programmer wanted.

BASIC256 is an entry level "structured" language and the extensibility you suggested are currently beyond the scope, today.

Jim

Connecting a variable to a command such as clg(enter)circle

by Milo, Tuesday, January 25, 2011, 15:37 (2316 days ago) @ Jim

Right, thanks.

RSS Feed of thread
powered by my little forum