add lof() to fileblock.yab
This commit is contained in:
@@ -154,6 +154,20 @@ rec=rec+1
|
|||||||
return rec
|
return rec
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
export sub lof(filehandle)
|
||||||
|
// returns the number of blocks in the file.
|
||||||
|
local x
|
||||||
|
filename$=f$(filehandle,0,0)
|
||||||
|
x=open(filename$)
|
||||||
|
seek #x, 0, "end"
|
||||||
|
ret=tell(#x)
|
||||||
|
if ret=0 return ret
|
||||||
|
|
||||||
|
ret= ret/(f(filehandle,51)+1)
|
||||||
|
ret=int(ret)
|
||||||
|
return ret
|
||||||
|
end sub
|
||||||
|
|
||||||
|
|
||||||
sub blank$(num)
|
sub blank$(num)
|
||||||
local s$
|
local s$
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ The files in this folder are yab libraries, to use them, copy to your project fo
|
|||||||
|
|
||||||
~/config/settings/yab
|
~/config/settings/yab
|
||||||
|
|
||||||
then use the include statement in your project.
|
then use the import statement in your project.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
include Toolbar
|
import Toolbar
|
||||||
Reference in New Issue
Block a user