From 7c924ab13879d694dda26c6fbc8ff8aa3802ec28 Mon Sep 17 00:00:00 2001 From: Jim Date: Thu, 11 Jun 2015 12:41:05 -0700 Subject: [PATCH] add lof() to fileblock.yab --- yab-IDE/Programs/libs/fileblock.yab | 14 ++++++++++++++ yab-IDE/Programs/libs/readme | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/yab-IDE/Programs/libs/fileblock.yab b/yab-IDE/Programs/libs/fileblock.yab index 32da93e..e2d7a4a 100644 --- a/yab-IDE/Programs/libs/fileblock.yab +++ b/yab-IDE/Programs/libs/fileblock.yab @@ -154,6 +154,20 @@ rec=rec+1 return rec 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) local s$ diff --git a/yab-IDE/Programs/libs/readme b/yab-IDE/Programs/libs/readme index 0624d00..ffb4c3f 100644 --- a/yab-IDE/Programs/libs/readme +++ b/yab-IDE/Programs/libs/readme @@ -2,8 +2,8 @@ The files in this folder are yab libraries, to use them, copy to your project fo ~/config/settings/yab -then use the include statement in your project. +then use the import statement in your project. Example: -include Toolbar \ No newline at end of file +import Toolbar \ No newline at end of file