home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / j / jlibv1.zip / JLIB.DOC next >
Text File  |  1992-12-25  |  13KB  |  285 lines

  1. JLib v1.0  Original Version -----------===================>>    12-25-92
  2.   A
  3. product of InfoFlex Software
  4.  
  5.  
  6.         Hello and thank you for using JLib.  JLib is a collection
  7.         of Functions and Sub Procedures for QuickBasic.  My goal as
  8.         the creator of JLib is to make it available to anyone who
  9.         needs it.  As time goes on I would like to build on to this
  10.         library.  I will be contributing new functions monthly and
  11.         will also take any functions or sub prodcedures that I see
  12.         might be useful from anybody who wants to contribute. 
  13.  
  14.         If you have something that you would like to add to JLib
  15.         please send a listing of your function or procedure to:
  16.  
  17.                         InfoFlex Software
  18.                         c/o Jason Young
  19.                         7785 NW Mitchel DR.
  20.                         Corvallis, OR 97330
  21.  
  22.         ALL contributions that have a complete WORKING listing and
  23.         documentation (try to include an example) will be strongly
  24.         considered.  This is your library.  All of the contributors
  25.         names will be added to a list and distributed with each
  26.         copy of JLib.
  27.  
  28.         Also if you would like the source code for any of these
  29.         functions or sub procedures you can send $20 to the address
  30.         above and a self addressed envelope (no stamp needed) to the
  31.         address above.  The address above is also valid for any
  32.         questions or comments.  ALL letters will be answered.  Or
  33.         in the event you do not want to write a letter you can send
  34.         me E-Mail on The White Knight BBS (503) 753-7260 for Jason Young.
  35.  
  36.         Thanx again for your support.
  37.  
  38.                        ■-=%%%%%%%%%%%%%%%%%%%=-■
  39.                        ■-=%   Jason Young   %=-■
  40.                        ■-=% CEO of InfoFlex %=-■
  41.                        ■-=%%%%%%%%%%%%%%%%%%%=-■
  42.  
  43. Functions -
  44.  
  45.         *********************************************************
  46.         *       These Functions need to be declared in the      *
  47.         *       beginning of your program.                      *
  48.         *       EXAMPLE ***                                     *
  49.         *               DECLARE FUNCTION Rand& ()               *
  50.         *********************************************************
  51.  
  52.         Rand&()
  53.                 EXAMPLE ***
  54.                         Index& = Rand&()
  55.  
  56.                 DESCRIPTION
  57.                         This function generates and pseudo-random Long
  58.                         Integer.
  59.  
  60.         NewWord$()
  61.                 EXAMPLE ***
  62.                         PassWord$ = NewWord$()
  63.                         PRINT "Your password is: ", PassWord$
  64.  
  65.                 DESCRIPTION
  66.                         NewWord$ generates a random, Semi-pernouncable word
  67.  
  68.         Collision% (Object%(), BackGround%())
  69.                 EXAMPLE ***
  70.                         DO
  71.                         PUT (x, y), Ball%
  72.                         x = x + 1
  73.                         y = y + 1
  74.                                 GET (x, y), BackGround%
  75.  
  76.                                 IF Collision% (Ball%(), BackGround%()) THEN
  77.                                         PRINT "*** COLLISION!!! ***":END
  78.                                 END IF
  79.                         PUT (x, y),Ball%
  80.                         LOOP
  81.  
  82.                 DESCRIPTION
  83.                         Collision% takes two integer GET/PUT arrays and
  84.                         tests to see if any pixels overlap or if any pixels
  85.                         are close to colliding.  This is useful for doing
  86.                         animations and writing arcade games.
  87.  
  88.         Bin2Hex$ (Bin$)
  89.                 EXAMPLE ***
  90.                         PRINT "This program will return the hexedecimal form"
  91.                         PRINT "of a binary number you enter"
  92.                         PRINT
  93.                         INPUT "What is you number: ", Bin$
  94.  
  95.                         PRINT "Your number in hex is: ";Bin2Hex$ (Bin$)
  96.  
  97.                 DESCRIPTION
  98.                         This function converts any binary string to
  99.                         hexedecimal form.
  100.  
  101.         Shade& (Red!, Green!, Blue!)
  102.                 EXAMPLE ***
  103.                         FOR i = 1 to 15
  104.                                 PALETTE i, Shade&(i * .2, i * .3, i * .4)
  105.                                 COLOR i
  106.                                 PRINT "This is my favorite color!!!"
  107.                         NEXT
  108.                 DESCRIPTION
  109.                         This function is very handy.  You can rotate Palette
  110.                         values to new colors customized by you.  You must
  111.                         supply a number between 1 to 0 to represent the
  112.                         amount of red, green, or blue to mix into your new
  113.                         color.
  114.  
  115.         Shuffle$ (Text$, PrintType)
  116.                 EXAMPLE ***
  117.                         Text$ = "Wowsers"
  118.                         Answer$ = Shuffle$(Text$, 1)
  119.                         PRINT "Unscramble this word: "; Answer$
  120.                         INPUT "", Guess$
  121.                                 IF Answer$ AND Guess$ THEN
  122.                                         PRINT "YES!!! That's it!!!"
  123.                                         END
  124.                                 ELSE
  125.                                         PRINT "NOPE!!!"
  126.                                         END
  127.                                 END IF
  128.                 DESCRIPTION
  129.                         Shuffle$ simply shuffles the order of the letters in
  130.                         a string.  The second argument, PrintType, lets you
  131.                         format the string as you want.  Here is a table that
  132.                         shows the results of each value that can be passed to
  133.                         the function:
  134.                                 Value   Result          Example
  135.                                --------------------------------
  136.                                | -1   | All of the   | rewsows|
  137.                                |      | letters are  |   =    |
  138.                                |      | returned in  | Wowsers|
  139.                                |      | lowercase    |        |
  140.                                |      | letters.     |        |
  141.                                --------------------------------
  142.                                |  0   | The letters  | reWsows|
  143.                                |      | will be      |   =    |
  144.                                |      | returned as  | Wowsers|
  145.                                |      | entered.     |        |
  146.                                --------------------------------
  147.                                |  1   | All of the   | REWSOWS|
  148.                                |      | letters are  |   =    |
  149.                                |      | returned in  | Wowsers|
  150.                                |      | Caps.        |        |
  151.                                --------------------------------
  152.  
  153. Sub Procedures-
  154.  
  155.         DOSversion ()
  156.                 EXAMPLE ***
  157.                         PRINT "You are running DOS version: ";
  158.                         CALL DOSversion
  159.                 DESCRIPTION
  160.                         DOSversion prints to the screen the current
  161.                         DOS version.
  162.  
  163.         FPrint (Word$, X, Y, C, B)
  164.                 EXAMPLE ***
  165.                         SCREEN 13
  166.                         CALL FPrint ("WOW JLIB IS GREAT!", 20, 20, 2, 10)
  167.                 DESCRIPTION
  168.                         FPrint will take a string (Word$) and print it
  169.                         anywhere on a graphics screen. 
  170.                         X - is the X Coordinate of where you want your
  171.                             string printed.
  172.                         Y - is the Y Coordinate of where you want your
  173.                             string printed.
  174.                         C - is the color to fill your letter with.
  175.                         B - is the color for the border of your letter.
  176.  
  177.         MouseFind (Found%)
  178.                 EXAMPLE ***
  179.                         CALL MouseFind (Found%)
  180.                         IF Found% = 0 THEN
  181.                                 PRINT "No mouse found!!!"
  182.                                 END
  183.                         ELSE
  184.                                 PRINT "Mouse found."
  185.                                 END
  186.                         END IF
  187.                 DESCRIPTION
  188.                         MouseFind searches for a mouse driver.  The variable
  189.                         Found% returns either 1 or 0 (1 means its found, 0
  190.                         means it wasn't).
  191.  
  192.         ShowMouse
  193.                 EXAMPLE ***
  194.                         CALL MouseFind (Found%)
  195.                         IF Found% = 0 THEN
  196.                                 PRINT "No mouse found!!!"
  197.                                 END
  198.                         ELSE
  199.                                 PRINT "Mouse found."
  200.                                 END
  201.                         END IF
  202.  
  203.                         CALL ShowMouse
  204.                 DESCRIPTION
  205.                         ShowMouse show the mouse cursor after the mouse is
  206.                         found.
  207.  
  208.         GetMouse (X, Y, Button)
  209.                 EXAMPLE ***
  210.                         CALL MouseFind (Found%)
  211.                         IF Found% = 0 THEN
  212.                                 PRINT "No mouse found!!!"
  213.                                 END
  214.                         ELSE
  215.                                 PRINT "Mouse found."
  216.                                 END
  217.                         END IF
  218.  
  219.                         CALL ShowMouse
  220.                         DO
  221.                                 CALL GetMouse(X, Y, Button)
  222.                                 LOCATE 1, 1
  223.                                         PRINT X, Y, BUTTON
  224.                         LOOP UNTIL INKEY$ <> ""
  225.                 DESCRIPTION
  226.                         GetMouse returns information about the mouse.
  227.                         X - X Coordinate of the mouse
  228.                         Y - Y Coordinate of the mouse
  229.                         Button -
  230.                                 1 - Left button
  231.                                 2 - Right button
  232.                                 4 - Both buttons
  233.  
  234.         ShadowBox (ULc%, ULr%, LRc%, LRr%, Col%)
  235.                 EXAMPLE ***
  236.                         SCREEN 12
  237.                         CALL ShadowBox (10, 10, 60, 60, 12)
  238.                 DESCRIPTION
  239.                         ShadowBox creates a graphic box with a dark gray
  240.                         shadow.
  241.                         ULc% - is the upper left column for the box
  242.                         ULr% - is the upper left row for the box
  243.                         LRc% - is the lower right column for the box
  244.                         LRr% - is the lower right row for the box
  245.                         Col% - is the color for the box
  246.  
  247.         TextScroll (Text$, Delay%, Buffer%, Row%, LCol%, Col%, Escape%)
  248.                 EXAMPLE ***
  249.                         Text$ = "Wow I love JLib!!!"
  250.                         Scroll:
  251.                         CALL TextScroll (Text$, 10, 5, 10, 6, 4, Escape%)
  252.                         IF Escape% <> 27 THEN GOTO Scroll:
  253.                 DESCRIPTION
  254.                         TextScroll scrolls any text across the screen.
  255.                         Text$ - text to scroll
  256.                         Delay% - You'll have to play with this to find a
  257.                                  decent speed.
  258.                         Buffer% - The number of spaces to put between each
  259.                                   scroll of Text$.
  260.                         Row% - The text row to scroll the string.
  261.                         LCol% - The column to start the scroll at.
  262.                         Escape% - The returned ASCII character number used
  263.                                   to exit the scroll
  264.         ReBoot ()
  265.                 EXAMPLE ***
  266.                         Password$ = "JLIB"
  267.                         INPUT "Enter the system password: ", Guess$
  268.                         IF Guess$ <> Password$ THEN CALL ReBoot
  269.                 DESCRIPTION
  270.                         Performes a soft reboot of your computer.
  271.  
  272.         PrtSc()
  273.                 EXAMPLE ***
  274.                         FOR i = 1 to 1000
  275.                                 PRINT CHR$(INT(RND(78) * 254) + 1)
  276.                         NEXT
  277.                         CALL PrtSc()
  278.                 DESCRIPTION
  279.                         Dumps text screen to your printer.
  280. *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+
  281.  
  282.         Well that's it for this version.  I hope you enjoy.  There will
  283.         be more to come later.
  284.  
  285.