TGC Codebase Backup



useful functions by Alexander Altman

20th Jul 2009 13:23
Summary

set of useful functions to be used in anything



Description

contains a set of useful functions; use whenever/however you like!

Version 1.0.0:
New:
sect$:
paramaters - string and two integers
returns - string
action - returns the specified section of the string (both ends inclusive)
round:
parameters - float
returns - integer
action - rounds to the nearest whole number (x.5 rounds to x+1)



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    function sect$(instring$,b,e)
 for k = b to e step 1
  r$ = r$ + mid$(instring$, k)
 next k
endfunction r$

function round(a#)
 r = int(a#+.5)
endfunction r