Author Topic: Library section  (Read 5847 times)

0 Members and 1 Guest are viewing this topic.

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Library section
« Reply #15 on: September 09, 2018, 11:50:41 am »
Just made my tests,

global variables and those declared SHARED within a SUB/FUNC must be DIMed in the main module, variables used in a SUB/FUNC only must be either DIMed within the SUB/FUNC for local variables, or alternatively declared as STATIC whithin the SUB/FUNC.

Damn, that sucks, who requested that OPTION _EXPLICIT thing to be built into QB64. I remember there was a big discussion on [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there] back the days, as it were only 1 or 2 people trying to convince the team to built it in. The small advantage of some kind of "spell checking" your variable names is nothing compared to the unnecessary obstacles it does cause, it's simply not worth it.
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Library section
« Reply #16 on: September 09, 2018, 11:53:25 am »
Ah, so a library must use OPTION _EXPLICIT in case user is coding with that option, in case user is NOT using that option, no harm done.

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Library section
« Reply #17 on: September 09, 2018, 12:09:57 pm »
Ah, so a library must use OPTION _EXPLICIT in case user is coding with that option, in case user is NOT using that option, no harm done.
No, unfortunately not, a library must be DIMing everything (a lot of writing in every single SUB/FUNC) to make sure it works without errors if the user happens to use OPTION _EXPLICIT. If the user otherwise does not use _EXPLICIT, then all the DIM writing in the library was unnecessary, it just bloats the exe file then.
« Last Edit: September 09, 2018, 12:13:04 pm by RhoSigma »
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

FellippeHeitor

  • Guest
Re: Library section
« Reply #18 on: September 09, 2018, 12:23:31 pm »
Doesn’t bloat the exe, you’re smarter than that, Rho. Don’t play the Clippy.

I added OPTION _EXPLICIT to the language for my own personal request/need although I know it had been requested/discussed before. Avoids typos and makes sure you don’t use a billion random var names for the same purpose throughout your code. That would bloat your exe and memory usage at runtime.

Besides being completely optional, it is only smart to use, so much that languages considered more efficient have mandatory var declaration.

I understand the anger because it means more work for one willing to write a library. Anyone willing to write a library should be willing to put a lot of work into it though, for quality purposes.
« Last Edit: September 09, 2018, 12:25:29 pm by FellippeHeitor »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Library section
« Reply #19 on: September 09, 2018, 12:26:34 pm »
Ah, so a library must use OPTION _EXPLICIT in case user is coding with that option, in case user is NOT using that option, no harm done.
No, unfortunately not, a library must be DIMing everything (a lot of writing in every single SUB/FUNC) to make sure it works without errors if the user happens to use OPTION _EXPLICIT. If the user otherwise does not use _EXPLICIT, then all the DIM writing in the library was unnecessary, it just bloats the exe file then.

It won't bloat the EXE any -- how could it??  We translate to C and, as a language, it requires everything to be declared anyway. 

All that happens with OPTION _EXPLICIT is the user has to manually declare each variable type in their program, rather than rely on the default definition -- rendering _DEFINE and DEFtype statements worthless and generating just a little more work/typing for the programmer.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Library section
« Reply #20 on: September 09, 2018, 12:53:04 pm »
Anyone willing to write a library should be willing to put a lot of work into it though, for quality purposes.

Yep, I agree. (The code looks funky below in the code window. Paste it into your IDE and it cleans up.)

Code: QB64: [Select]
  1. '*
  2. '* constants used with SL_LoadSpriteSheet function
  3. '*
  4.  
  5. CONST SL_SHEETTRANSPARENCY = -1 '       use sheet's transparency info (.PNG)
  6. CONST SL_SETTRANSPARENCY = 0 '          manually set transparency
  7. CONST SL_NOTRANSPARENCY = 1 '           don't use transparency with sheet
  8.  
  9. '*
  10. '* type declarations
  11. '*
  12.  
  13. TYPE SL_SHEET
  14.     inuse AS INTEGER '                  sheet is in use (true / false)
  15.     sheetimage AS LONG '                image handle of sheet
  16.     sheetwidth AS INTEGER '             width of sheet
  17.     sheetheight AS INTEGER '            height of sheet
  18.     spritewidth AS INTEGER '            width of each sprite
  19.     spriteheight AS INTEGER '           height of each sprite
  20.     transparency AS INTEGER '           sheet transparency type
  21.     transcolor AS _UNSIGNED LONG '      transparent color on sheet
  22.     columns AS INTEGER '                number of sprite columns
  23.     rows AS INTEGER '                   number of sprite rows
  24.  
  25. TYPE SL_SPRITES
  26.     sprite AS LONG '                    hardware image
  27.     image AS LONG '                     software image
  28.     mask AS LONG '                      software mask image
  29.     xoffset AS INTEGER '                x offset from center
  30.     yoffset AS INTEGER '                y offset from center
  31.     spritewidth AS INTEGER '            width of sprite
  32.     spriteheight AS INTEGER '           height of sprite
  33.  
  34. '*
  35. '* defined arrays
  36. '*
  37.  
  38. REDIM SL_sheet(1) AS SL_SHEET '             sprite sheet list
  39. REDIM SL_sprites(1, 1, 1) AS SL_SPRITES '   master sprite array
  40. '*
  41. '* main code (for testing)
  42. '*
  43. tr3bsheet = SL_LoadSpriteSheet("tr3bsheet266x266.png", 266, 266, SL_SETTRANSPARENCY, _RGB32(255, 0, 255))
  44.  
  45. PRINT tr3bsheet
  46. PRINT SL_sprites(tr3bsheet, 0, 0).sprite
  47. PRINT SL_sprites(tr3bsheet, 0, 0).spritewidth
  48. PRINT SL_sprites(tr3bsheet, 0, 0).spriteheight
  49.  
  50.  
  51. '    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  52. FUNCTION SL_LoadSpriteSheet (filename AS STRING, spritewidth AS INTEGER, spriteheight AS INTEGER, transparency AS INTEGER, transcolor AS _UNSIGNED LONG) '                           SL_LoadSpriteSheet
  53.     'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  54.     '³                    °°°±±±²²²ÛÛÛ COMMAND DESCRIPTION AND USAGE ÛÛÛ²²²±±±°°°                     ³                                °°°±±±²²²ÛÛÛ NOTES ÛÛÛ²²²±±±°°°                                ³
  55.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  56.     '³ Loads a sprite sheet's sprites into memory and stores them in the sprite sheet array. Three    ³ - The software image mask will only be created if the sprite sheet contains a transparency    ³
  57.     '³ sprite images are created for each sprite; a hardware image for displaying, a software image   ³   layer (alpha channel) either built-in or user defined.                                      ³
  58.     '³ for manipulating, and a software mask image for pixel collision detection.                     ³ - Three constants have been created for use with this function:                               ³
  59.     '³                                                                                                ³   : SL_SHEETTRANSPARENCY (-1) to have the function use built-in sprite sheet's alpha layer.   ³
  60.     '³ mysheet% = SL_LoadSpriteSheet("sprites.png", 64, 96, SL_SETTRANSPARENCY, _RGB32(255, 0, 255))  ³   : SL_SETTRANSPARENCY   ( 0) to have the function use the programmer supplied alpha value.   ³
  61.     '³                                                                                                ³   : SL_NOTRANSPARENCY    ( 1) to have the function ignore alpha channel completely.           ³
  62.     '³ Input:  filename     - the name of the sprite sheet image file to load in.                     ³ - The function will report an error on the following conditions:                              ³
  63.     '³         spritewidth  - the width of every sprite contained on the sprite sheet.                ³   : A filename is supplied that does not exist.                                               ³
  64.     '³         spriteheight - the height of every sprite contained on the sprite sheet.               ³   : A sprite width or height that is less than one (1).                                       ³
  65.     '³         transparency - the type of transparency to apply to the sprite sheet and sprites:      ³   : An invalid transparency type value. Valid types are from negative one (-1) to one (1).    ³
  66.     '³                         : -1 - use the sprite sheet's built-in alpha channel (PNG files).      ³ - The programmer supplied alpha channel value will be ignored if transparency is not set to a ³
  67.     '³                         :  0 - use the programmer assigned alpha channel value.                ³   value of zero (0).                                                                          ³
  68.     '³                         :  1 - this sheet does not have any transparency included.             ³                                                                                               ³
  69.     '³         transcolor   - programmer assigned alpha channel value for the sprite sheet.           ³                                                                                               ³
  70.     '³                                                                                                ³                                                                                               ³
  71.     '³ Output: An integer value greater than zero (0) that acts as a handle pointing to the sheet     ³                                                                                               ³
  72.     '³         that contains the sprites.                                                             ³                                                                                               ³
  73.     '³                                                                                                ³                                                                                               ³
  74.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  75.     '³                            °°°±±±²²²ÛÛÛ KNOWN ISSUES ÛÛÛ²²²±±±°°°                              ³                               °°°±±±²²²ÛÛÛ CREDITS ÛÛÛ²²²±±±°°°                               ³
  76.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  77.     '³ None                                                                                           ³ None                                                                                          ³
  78.     '³                                                                                                ³                                                                                               ³
  79.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  80.     '³                                                                          °°°±±±²²²ÛÛÛ THEORY OF OPERATION ÛÛÛ²²²±±±°°°                                                                         ³
  81.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  82.     '³ Once the sprite sheet is loaded it is scanned for an alpha channel if the programmer requests to use the sheet's transparency layer. The width and height of the sheet are retrieved and then  ³
  83.     '³ divided by the sprite dimensions provided by the programmer to determine how many columns and rows of sprites exist. Each sprite is then brought in one at a time and trimmed down so only the ³
  84.     '³ image itself is left. This cuts away any extra background/transparency areas so as to make the sprite as small as possible. An x and y offset are then calculated so when the sprite is placed ³
  85.     '³ on the screen it matches the other sprites and they align correclty. A sheet entry is created in a three dimensional array where the first dimension is the sheet number (the handle), the     ³
  86.     '³ second and third dimensions are then related to the sprite column and row locations on the sheet. So, for instance if three sheets are loaded, and I want to access the sprite located on      ³
  87.     '³ sheet 2 in the 4th column and 5th row it can be found at SL_sprites(2, 4, 5). Each array location holds a hardware sprite image, a software sprite image, a software mask image, and any info  ³
  88.     '³ related to the sprite that is important, such as it's width, height, and location on screen.                                                                                                   ³
  89.     '³                                                                                                                                                                                                ³
  90.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  91.     '³                                                                                °°°±±±²²²ÛÛÛ HISTORY ÛÛÛ²²²±±±°°°                                                                               ³
  92.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  93.     '³ Date: 09/09/18 by Terry Ritchie                                                                                                                                                                ³
  94.     '³     : Initial writing of code.                                                                                                                                                                 ³
  95.     '³                                                                                                                                                                                                ³
  96.     'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  97.  
  98.     ' declare global variables
  99.  
  100.     SHARED SL_sprites() AS SL_SPRITES
  101.  
  102.     ' declare local variables
  103.  
  104.     DIM handle AS INTEGER '         handle (pointer) number of new sprite sheet
  105.     DIM x AS INTEGER '              generic counter
  106.     DIM y AS INTEGER '              generic counter
  107.     DIM x1 AS INTEGER '             generic counter
  108.     DIM y1 AS INTEGER '             generic ocunter
  109.     DIM osource AS LONG '           original source image
  110.     DIM odest AS LONG '             original destination image
  111.     DIM pixel AS _UNSIGNED LONG '   pixel color at x%, y% coordinate
  112.     DIM alpha AS _UNSIGNED LONG '   alpha level of current pixel
  113.     DIM tempsprite AS LONG '        temporary sprite image holder
  114.     DIM top AS INTEGER '            upper boundary of sprite image
  115.     DIM bottom AS INTEGER '         lower boundary of sprite image
  116.     DIM left AS INTEGER '           left boundary of sprite image
  117.     DIM right AS INTEGER '          right boundary of sprite image
  118.     DIM sheetimage AS LONG '        sprite sheet file image
  119.     DIM sheetwidth AS INTEGER '     width of sprite sheet in pixels
  120.     DIM sheetheight AS INTEGER '    height of sprite sheet in pixels
  121.     DIM rows AS INTEGER '           number of sprite rows contained on sheet
  122.     DIM columns AS INTEGER '        number of sprite columns contained on sheet
  123.  
  124.     ' perform error checks
  125.  
  126.     IF NOT _FILEEXISTS(filename) THEN '                                                                 does the sprite sheet exist?
  127.         SL_SpriteError "SL_LoadSpriteSheet", 106, filename '                                            no, report error to programmer
  128.     END IF
  129.     IF ABS(transparency) > 1 THEN '                                                                     valid transparency setting?
  130.         SL_SpriteError "SL_LoadSpriteSheet", 108, "" '                                                  no, report error to programmer
  131.     END IF
  132.     IF spritewidth < 1 OR spriteheight < 1 THEN '                                                       valid sprite width/height supplied?
  133.         SL_SpriteError "SL_LoadSpriteSheet", 109, "" '                                                  no, report error to programmer
  134.     END IF
  135.  
  136.     ' local variable setup
  137.  
  138.     osource = _SOURCE '                                                                                 remember current source image
  139.     odest = _DEST '                                                                                     remember current destination image
  140.     handle = 0 '                                                                                        initialize handle value
  141.     sheetimage = _LOADIMAGE(filename, 32) '                                                             load sprite sheet file
  142.     sheetwidth = _WIDTH(sheetimage) '                                                                   get width of sheet
  143.     sheetheight = _HEIGHT(sheetimage) '                                                                 get height of sheet
  144.     columns = sheetwidth \ spritewidth '                                                                get number of whole columns of sprites
  145.     rows = sheetheight \ spriteheight '                                                                 get number of whole rows of sprites
  146.  
  147.     ' increase sprite array's 1st dimensions if needed to create a new sprite sheet
  148.  
  149.     DO '                                                                                                look for the next available handle
  150.         handle = handle + 1 '                                                                           increment the handle value
  151.     LOOP UNTIL (NOT SL_sprites(handle, 0, 0).sprite) OR handle = UBOUND(SL_sprites) '                   stop looking when valid handle value found
  152.     IF SL_sprites(handle, 0, 0).sprite = -1 THEN '                                                      is the last array element in use?
  153.         handle = handle + 1 '                                                                           yes, increment the handle value
  154.         REDIM _PRESERVE SL_sprites(handle, UBOUND(SL_sprites, 2), UBOUND(SL_sprites, 3)) AS SL_SPRITES 'create new sheet in sprite array
  155.     END IF
  156.  
  157.     ' increase sprite array's 2nd and 3rd dimensions if needed to match number of rows and columns
  158.  
  159.     IF columns > UBOUND(SL_sprites, 2) THEN '                                                           more columns in this sheet than others?
  160.         REDIM _PRESERVE SL_sprites(handle, columns, UBOUND(SL_sprites, 3)) AS SL_SPRITES '              yes, increase the array's 2nd dimension to match
  161.     END IF
  162.     IF rows% > UBOUND(SL_sprites, 3) THEN '                                                             more rows in this sheet than others?
  163.         REDIM _PRESERVE SL_sprites(handle, UBOUND(SL_sprites, 2), rows) AS SL_SPRITES '                 yes, increase the array's 3rd dimension to match
  164.     END IF
  165.  
  166.     ' the variables in SL_sprites(x, 0, 0) will serve a dual purpose
  167.     ' SL_sprites(x, 0, 0).sprite will contain either -1 (true) or 0 (false) to indicate the first dimension of the array is in use.
  168.     ' SL_sprites(x, 0, 0).spritewidth will contain the number of columns contained in the sheet (the array's 2nd dimension)
  169.     ' SL_sprites(x, 0, 0).spriteheight will contain the number of rows contained in the sheet (the array's 3rd dimension)
  170.  
  171.     SL_sprites(handle%, 0, 0).sprite = -1 '                                                             mark as in use
  172.     SL_sprites(handle%, 0, 0).spritewidth = columns '                                                   remember number of columns in sheet
  173.     SL_sprites(handle%, 0, 0).spriteheight = rows '                                                     remember number of rows in sheet
  174.  
  175.     ' identify transparency of sprite sheet if requested
  176.  
  177.     IF transparency = -1 THEN '                                        (constant SL_SHEETTRANSPARENCY)  sheet have alpha channel?
  178.         x = 0 '                                                                                         yes, start at upper left x of sheet
  179.         y = 0 '                                                                                         start at upper left y of sheet
  180.         alpha = 255 '                                                                                   assume no alpha channel
  181.         _SOURCE sheetimage '                                                                            set sprite sheet image as source image
  182.         DO '                                                                                            start looping through the sheet's pixels
  183.             pixel = POINT(x, y) '                                                                       get the pixel's color attributes
  184.             alpha = _ALPHA32(pixel) '                                                                   get the alpha level (0 - 255)
  185.             IF alpha = 0 THEN EXIT DO '                                                                 if it is transparent then leave the loop
  186.             x = x + 1 '                                                                                 move right one pixel
  187.             IF x > sheetwidth THEN '                                                                    have we gone off the sheet?
  188.                 x = 0 '                                                                                 yes, reset back to the left beginning
  189.                 y = y + 1 '                                                                             move down one pixel
  190.             END IF
  191.         LOOP UNTIL y > sheetheight '                                                                    don't stop until the entire sheet has been checked
  192.         IF alpha = 0 THEN '                                                                             did we find a transparent pixel?
  193.             transcolor = pixel '                                                                        yes, set the sheet's transparency to this color
  194.         ELSE '                                                                                          no transparency found within sheet
  195.             transparency = 1 '                                                                          set sheet to having no alpha channel
  196.         END IF
  197.     ELSEIF transparency = 0 THEN '                                       (constant SL_SETTRANSPARENCY)  manually set alpha channel?
  198.         _CLEARCOLOR transcolor, sheetimage '                                                            yes, apply alpha setting to sheet
  199.     END IF
  200.  
  201.     ' load sprites from sheet and place into sprite array
  202.  
  203.     tempsprite = _NEWIMAGE(spritewidth, spriteheight, 32) '                                             create a temporary sprite holder
  204.     FOR x = 1 TO columns '                                                                              cycle through the sheet's columns
  205.         FOR y = 1 TO rows '                                                                             cycle through the sheet's rows
  206.  
  207.             ' get sprite from sheet and place in temporary image
  208.  
  209.             _PUTIMAGE , sheetimage, tempsprite, ((x - 1) * spritewidth, (y - 1) * spriteheight)-_
  210.                 ((x - 1) * spritewidth + spritewidth - 1, (y - 1) * spriteheight + spriteheight - 1) '  get sprite from sheet and place in temp image
  211.  
  212.             ' identify image boundaries
  213.  
  214.             _SOURCE tempsprite '                                                                        work from the temporary sprite image
  215.             top = spriteheight '                                                                        seed the boundary marker variables
  216.             left = spritewidth
  217.             bottom = 0
  218.             right = 0
  219.             FOR x1 = 0 TO spritewidth - 1 '                                                             cycle through the width of temp sprite
  220.                 FOR y1 = 0 TO spriteheight - 1 '                                                        cycle through the height of temp sprite
  221.                     IF POINT(x1, y1) <> transcolor THEN '                                               is this pixel a transparent color?
  222.                         IF x1 < left THEN left = x1 '                                                   no, save position if left-most pixel
  223.                         IF y1 < top THEN top = y1 '                                                     save position if top-most pixel
  224.                         IF x1 > right THEN right = x1 '                                                 save position if right-most pixel
  225.                         IF y1 > bottom THEN bottom = y1 '                                               save position if bbottom-most pixel
  226.                     END IF
  227.                 NEXT y1
  228.             NEXT x1
  229.  
  230.             ' cut software image from temporary sprite and save
  231.  
  232.             SL_sprites(handle, x, y).image = _NEWIMAGE(right - left, bottom - top, 32) '                create software image holder with computed boundaries
  233.             _PUTIMAGE , tempsprite, SL_sprites(handle, x, y).image, (left, top)-(right, bottom) '       cut sprite from temp and place in software image
  234.             SL_sprites(handle, x, y).xoffset = spritewidth \ 2 - left '                                 remember x offset from center
  235.             SL_sprites(handle, x, y).yoffset = spriteheight \ 2 - top '                                 remember y offset from center
  236.             SL_sprites(handle, x, y).spritewidth = right - left '                                       remember sprite width  *********** (note to self: may want to remember     ) *
  237.             SL_sprites(handle, x, y).spriteheight = bottom - top '                                      remember sprite height *********** (sprite width/height from sheet as well?) *
  238.  
  239.             ' generate software image mask and save
  240.  
  241.             IF transparency < 1 THEN '                                                                  is there a transparency layer?
  242.                 SL_sprites(handle, x, y).mask = _NEWIMAGE(right - left, bottom - top, 32) '             yes, create a software image to hold a sprite mask
  243.                 _SOURCE SL_sprites(handle, x, y).image '                                                work from the saved sprite image
  244.                 _DEST SL_sprites(handle, x, y).mask '                                                   write to the newly created mask image
  245.                 FOR x1 = 0 TO SL_sprites(handle, x, y).spritewidth '                                    cycle through the width of the sprite
  246.                     FOR y1 = 0 TO SL_sprites(handle, x, y).spriteheight '                               cycle through the height of the sprite
  247.                         IF POINT(x1, y1) = transcolor THEN '                                            is this pixel a transparent color?
  248.                             PSET (x1, y1), _RGB32(255, 255, 255) '                                      yes, set as white on the mask image
  249.                         END IF
  250.                     NEXT y1
  251.                 NEXT x1
  252.             END IF
  253.  
  254.             ' generate hardware sprite
  255.  
  256.             SL_sprites(handle, x, y).sprite = _COPYIMAGE(SL_sprites(handle, x, y).image, 33) '          create a hardware image of sprite to use for displaying
  257.         NEXT y
  258.     NEXT x
  259.     _FREEIMAGE tempsprite '                                                                             temporary sprite image no longer needed
  260.     _FREEIMAGE sheetimage '                                                                             sprite sheet image no longer needed
  261.     _SOURCE osource '                                                                                   return source to current
  262.     _DEST odest '                                                                                       return destination to current
  263.     SL_LoadSpriteSheet = handle '                                                                       return the handle number pointing to this sheet
  264.  
  265.  
  266. '    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  267. SUB SL_SpriteError (routine AS STRING, errno AS INTEGER, info AS STRING) '                                                                                                               SL_SpriteError
  268.     'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  269.     '³                    °°°±±±²²²ÛÛÛ COMMAND DESCRIPTION AND USAGE ÛÛÛ²²²±±±°°°                     ³                                °°°±±±²²²ÛÛÛ NOTES ÛÛÛ²²²±±±°°°                                ³
  270.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  271.     '³ Reports a Sprite Library error to the programmer. Used internally only.                        ³ - A copy of this library has been provided that has all of the error checks removed. Once     ³
  272.     '³                                                                                                ³   you are sure no errors exist you would then include that library for your final             ³
  273.     '³ Input : routine - the function/subroutine the error occurred in                                ³   compilation. The error checking routines do take some processing away from your code so     ³
  274.     '³                                                                                                ³   performance will improve by removing them.                                                  ³
  275.     '³ Input : errno   - the error number associated with the error                                   ³                                                                                               ³
  276.     '³                   100 - sprite does not exist                                                  ³                                                                                               ³
  277.     '³                   101 - sprite is not in use                                                   ³                                                                                               ³
  278.     '³                   102 - sprite can't be hidden                                                 ³                                                                                               ³
  279.     '³                   103 - invalid zoom value                                                     ³                                                                                               ³
  280.     '³                   104 - invalid rotation angle                                                 ³                                                                                               ³
  281.     '³                   105 - invalid flipping behavior                                              ³                                                                                               ³
  282.     '³                   106 - sheet does not exist                                                   ³                                                                                               ³
  283.     '³                   107 - sheet is not in use                                                    ³                                                                                               ³
  284.     '³                   108 - invalid transparency setting                                           ³                                                                                               ³
  285.     '³                   109 - invalid sprite width/height                                            ³                                                                                               ³
  286.     '³                                                                                                ³                                                                                               ³
  287.     '³         info    - any information that need to be conveyed with the error                      ³                                                                                               ³
  288.     '³                   such as a file name                                                          ³                                                                                               ³
  289.     '³                                                                                                ³                                                                                               ³
  290.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  291.     '³                            °°°±±±²²²ÛÛÛ KNOWN ISSUES ÛÛÛ²²²±±±°°°                              ³                               °°°±±±²²²ÛÛÛ CREDITS ÛÛÛ²²²±±±°°°                               ³
  292.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  293.     '³ none                                                                                           ³ This routine was created in response to a request from QB64 member pitt                       ³
  294.     '³                                                                                                ³ http://www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]/forum/index.php?topic=7281.0 (link no longer works)                       ³
  295.     '³                                                                                                ³                                                                                               ³
  296.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  297.     '³                                                                          °°°±±±²²²ÛÛÛ THEORY OF OPERATION ÛÛÛ²²²±±±°°°                                                                         ³
  298.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  299.     '³ A pure text screen is shown, the font reset to default, and _AUTODISPLAY enabled. This forces the code out of any graphics screen it may currently be in. The error is then displayed to the   ³
  300.     '³ programmer based on the values passed in. The program is then forced to terminate.                                                                                                             ³
  301.     '³                                                                                                                                                                                                ³
  302.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  303.     '³                                                                                °°°±±±²²²ÛÛÛ HISTORY ÛÛÛ²²²±±±°°°                                                                               ³
  304.     'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  305.     '³ Date: 09/09/18 by Terry Ritchie                                                                                                                                                                ³
  306.     '³     : Initial writing of code.                                                                                                                                                                 ³
  307.     '³                                                                                                                                                                                                ³
  308.     'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  309.  
  310.     SCREEN 0, 0, 0, 0 '                                                             go to a pure text screen
  311.     _FONT 16 '                                                                      set the standard screen 0 font
  312.     IF _FULLSCREEN THEN _FULLSCREEN _OFF '                                          turn off full screen if on
  313.     _AUTODISPLAY '                                                                  auto update the display
  314.     CLS '                                                                           clear the screen
  315.     PRINT "**" '                                                                    print error header
  316.     PRINT "** Sprite Library error encountered"
  317.     PRINT "**"
  318.     PRINT
  319.     PRINT routine; " has reported the following error:" '                           print sub/function reporting the error
  320.     PRINT
  321.     SELECT CASE errno '                                                             which error number is being reported?
  322.         CASE 100
  323.             PRINT "- the specified sprite does not exist"
  324.             PRINT "- it was either never created or removed with SPRITEFREE"
  325.         CASE 101
  326.             PRINT "- the specified sprite is not in use"
  327.             PRINT "- it was probably removed with SPRITEFREE"
  328.         CASE 102
  329.             PRINT "- the specified sprite can't be hidden"
  330.             PRINT "- change the sprite's behavior in SPRITENEW to save background"
  331.         CASE 103
  332.             PRINT "- the zoom value specified must be greater than zero"
  333.         CASE 104
  334.             PRINT "- the angle specified must be 0 to 360"
  335.         CASE 105
  336.             PRINT "- invalid flipping behavior specified - valid settings are"
  337.             PRINT "- : 0 = no flipping     (constant SL_NONE)"
  338.             PRINT "- : 1 = flip horizontal (constant SL_HORIZONTAL)"
  339.             PRINT "- : 2 = flip vertical   (constant SL_VERTICAL)"
  340.             PRINT "- : 3 = flip both       (constant SL_BOTH)"
  341.         CASE 106
  342.             PRINT "- "; CHR$(34); info; CHR$(34); " sprite sheet does not exist"
  343.             PRINT "- check path or spelling"
  344.         CASE 107
  345.             PRINT "- the specified sprite sheet is not in use"
  346.         CASE 108
  347.             PRINT "- invalid transparency setting supplied - valid settings are"
  348.             PRINT "- : -1 (constant SL_SHEETTRANSPARENCY)"
  349.             PRINT "- :  0 (constant SL_SETTRANSPARENCY)"
  350.             PRINT "- :  1 (constant SL_NOTRANSPARENCY)"
  351.         CASE 109
  352.             PRINT "- sprite width and height must be greater than zero"
  353.     END SELECT
  354.     DO: LOOP UNTIL INKEY$ = "" '                                                    clear the keyboard buffer
  355.     END '                                                                           end the program
  356.  
  357.  
  358.  
  359.  
  360.  
  361. '    ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  362.  
  363. 'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
  364. '³                    °°°±±±²²²ÛÛÛ COMMAND DESCRIPTION AND USAGE ÛÛÛ²²²±±±°°°                     ³                                °°°±±±²²²ÛÛÛ NOTES ÛÛÛ²²²±±±°°°                                ³
  365. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  366. '³                                                                                                ³                                                                                               ³
  367. '³                                                                                                ³                                                                                               ³
  368. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  369. '³                            °°°±±±²²²ÛÛÛ KNOWN ISSUES ÛÛÛ²²²±±±°°°                              ³                               °°°±±±²²²ÛÛÛ CREDITS ÛÛÛ²²²±±±°°°                               ³
  370. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  371. '³                                                                                                ³                                                                                               ³
  372. '³                                                                                                ³                                                                                               ³
  373. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  374. '³                                                                          °°°±±±²²²ÛÛÛ THEORY OF OPERATION ÛÛÛ²²²±±±°°°                                                                         ³
  375. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  376. '³                                                                                                                                                                                                ³
  377. '³                                                                                                                                                                                                ³
  378. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  379. '³                                                                                °°°±±±²²²ÛÛÛ HISTORY ÛÛÛ²²²±±±°°°                                                                               ³
  380. 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
  381. '³                                                                                                                                                                                                ³
  382. '³                                                                                                                                                                                                ³
  383. 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  384.  
In order to understand recursion, one must first understand recursion.

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Library section
« Reply #21 on: September 09, 2018, 01:17:26 pm »
Doesn’t bloat the exe, you’re smarter than that, Rho. Don’t play the Clippy.
Ok, ok, just tested, it really doesn't bloat, to be honest I just assumed more code in QB64 = more code in C/C++ = more bytes in exe, but obviously the vars are declared on C/C++ level anyways, doesn't matter if expicitly DIMed or not on the QB64 level.

However, it will definitly bloat and finally blow up my wife some day, when I need half an hour more a day in front of my PC just to hammer in all that DIMs into my code :) Would rather use the time for some constructive code, however it is as it is, I see a lot of DIMs down the road for my libraries...., well, not before we find a consensus and finally write the rules down as (binding) recommendation for library implementors.

My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack