LoginLogin

Structs Library

Root / Submissions / [.]

snail_Created:
Download:KEV343A4
Version:1.1Size:15.9 KB
This library allows the programmer to define, instantiate, and manipulate structs within SmileBASIC. This library is created with vanilla SB code, no funny tricks. Simple, efficient, and applicable to a broad range of scenarios, it brings SB one step closer to object-oriented paradigms.

Instructions:

Contained in the package are multiple files. The actual library is the PRG SNL_STRUCT.LIB, the rest are test and example files included for demonstration purposes. A complete documentation is coming, but for now examine the examples to get a feel for how it works.

DATA "STRING","KEY"
'4KXP3EBD

Replying to:12Me21
DATA "STRING","KEY"
'4KXP3EBD
"What's the key?"
PRINT FIELD(L,"KEY")

@STRUCT_PROGRAM
 DATA "STRING","NAME" 
 DATA "STRING","AUTHOR" 
 DATA "FLOAT","VERSION"
 DATA "STRING","KEY"
DATA "END"

DIM LIB[0]
STRUCT "PROGRAM" OUT LIB
SET LIB,"NAME","Structs Library"
SET LIB,"AUTHOR","slackerSnail"
SET LIB,"KEY","4KXP3EBD"
SET LIB,"VERSION",1.0

PRINT FIELD(LIB,"NAME");" ";FIELD(LIB,"VERSION")
PRINT "By: ";FIELD(LIB,"AUTHOR")
PRINT "Key: ";FIELD(LIB,"KEY")

Replying to:12Me21
DATA "STRING","KEY"
'4KXP3EBD
SET L,"KEY","REMOVED"

Hey. I have a problem, in FLOATTEST, the output is that I have is:
1
1
When I think it should be the values of PI() and EXP()

Replying to:hakke
Hey. I have a problem, in FLOATTEST, the output is that I have is:
1
1
When I think it should be the values of PI() and EXP()
Oops. I made a great mistake. Sorry!

Why are we making programming languages again??? Why are they so hard to learn and not begginner oriented languages??? Questions are fun.

Replying to:Defaultio
Why are we making programming languages again??? Why are they so hard to learn and not begginner oriented languages??? Questions are fun.
This isn't a language, this provides an interface and a struct data type.