what are libraries?
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Libraries are groups of SUB routines to include into the code.... If you have a hundred SUBs that are used for costum commands like:
You could make them into a lib.... So, insted of the code being like this:
It be like this:
Cuts down on lines of code, and makes things look nicer.. ..
Quick compare: Libraries in life are buildings with books of knowlegde we can go to and use;;; Libraries in code are the same, the code can go to these files and use the routines from them...
Code: Select all
SUB TYPE(TEXT01$, X01, Y01)
FOR i = 1 TO LEN(TEXT01$)
T! = TIMER
PTRL$ += MID$(TEXT01$, i, 1)
LOCATE Y01, X01: PRINT PTRL$;
DO: LOOP UNTIL (TIMER - T!) >= .2
NEXT
END SUB
Code: Select all
DECLARE SUB TYPE(TEXT01$, X01, Y01)
TYPE "Hello, world", 1, 1
SLEEP
SUB TYPE(TEXT01$, X01, Y01)
FOR i = 1 TO LEN(TEXT01$)
T! = TIMER
PTRL$ += MID$(TEXT01$, i, 1)
LOCATE Y01, X01: PRINT PTRL$;
DO: LOOP UNTIL (TIMER - T!) >= .2
NEXT
END SUB
Code: Select all
'$include: 'type.bi'
TYPE "Hello, world", 1, 1
SLEEP
Quick compare: Libraries in life are buildings with books of knowlegde we can go to and use;;; Libraries in code are the same, the code can go to these files and use the routines from them...
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
Take my above example,. insted of doing this every time I want a typing effect:Dictionary.com wrote:Routine
Computer Science. A set of programming instructions designed to perform a specific limited task.
Code: Select all
TEXT01$ = "Hello, world": X01 = 1: Y01 = 1
FOR i = 1 TO LEN(TEXT01$)
T! = TIMER
PTRL$ += MID$(TEXT01$, i, 1)
LOCATE Y01, X01: PRINT PTRL$;
DO: LOOP UNTIL (TIMER - T!) >= .2
NEXT
TEXT01$ = "How are you?": X01 = 1: Y01 = 2
FOR i = 1 TO LEN(TEXT01$)
T! = TIMER
PTRL$ += MID$(TEXT01$, i, 1)
LOCATE Y01, X01: PRINT PTRL$;
DO: LOOP UNTIL (TIMER - T!) >= .2
NEXT
Code: Select all
TYPE "Hello, world", 1, 1
TYPE "How are you?", 1, 2
SUB TYPE(TEXT01$, X01, Y01)
FOR i = 1 TO LEN(TEXT01$)
T! = TIMER
PTRL$ += MID$(TEXT01$, i, 1)
LOCATE Y01, X01: PRINT PTRL$;
DO: LOOP UNTIL (TIMER - T!) >= .2
NEXT
END SUB
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
- The Awakened
- Veteran
- Posts: 144
- Joined: Sun Aug 07, 2005 1:51 am
Yes, but often times libraries are written in a different programming language, especially assembly, to make things like drawing graphics really fast, or to do things like sound and music that would otherwise take a lot of study and expermentation.
"Sorry for beating you up with a baseball bat Julian, but I DID think that you were a samsquanch."
Re: what are libraries?
Large buildings with many objects inside called "books"...they contain these things called "pages", on which are written "words".... or guest or ???? wrote:what are libraries?
-
- Veteran
- Posts: 703
- Joined: Sun Nov 14, 2004 7:36 am
- Contact:
LOL Nek....I'm sure that answered all his questions LOL
When God created light, so too was born, the first Shadow!
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
MystikShadows
Need hosting? http://www.jc-hosting.net
Interested in Text & ASCII development? Look no further!
http://www.ascii-world.com
- The Awakened
- Veteran
- Posts: 144
- Joined: Sun Aug 07, 2005 1:51 am
Look in the tutorials on Pete's site, specifically on commands like BSAVE, BLOAD, GET, PUT, and stuff like that.... or guest or ???? wrote:o i think i get it more now
o yeah is there an easier way to do graphics than using that data table thingy because it takes forever to draw 1 small picture
"Sorry for beating you up with a baseball bat Julian, but I DID think that you were a samsquanch."
- The Awakened
- Veteran
- Posts: 144
- Joined: Sun Aug 07, 2005 1:51 am