View+ Forum Index View+
Review http://mypsion.ru/viewplus.php
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   Join! (free) Join! (free)
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MBMSplit code snippet

 
Post new topic   Reply to topic    View+ Forum Index -> ER5 OPL corner
View previous topic :: View next topic  
Author Message
Please Register and Login to this forum to stop seeing this advertsing.






Posted:     Post subject:

Back to top
Edo



Joined: 10 Aug 2005
Posts: 390


Location: Prismen - Vis

PostPosted: Thu Sep 22, 2005 8:15 am    Post subject: MBMSplit code snippet Reply with quote

This is the simplest way to split multi(MBM) file into single bitmaps.
Bitmap files will be saved in the same folder where the source file is found, like file.000.mbm, file.001.mbm etc...

Edo



Code:

REM Code snippet ŠEdo   20.09.05.
REM Split multi(MBM) into single bitmaps

INCLUDE "Const.oph"

PROC Main:
   LOCAL bitmaps%, MBM$(255)
 
   dINIT "Split MBM file into single bitmaps", KDlgButRight%
   dFILE MBM$, "MBM file:", KDFileSelectorWithSystem%
   dBUTTONS "Cancel",KDButtonEsc%, "Ok",KDButtonEnter%
   IF 0 = DIALOG
      STOP
   ENDIF

   bitmaps%=MBMSplit%:(MBM$)
   PRINT ""
   PRINT "Extracted", NUM$(bitmaps%,3), "bitmaps"
   PRINT "Press any key to close"
   GET
ENDP

PROC MBMSplit%:(File$)
   LOCAL bitmaps%, bit%,p%(6),bitmap$(255)

   PRINT "Extracting bitmaps from", File$, CHR$(133)
   PRINT ""

   ONERR End::
   WHILE KTrue%
      bit% = gLOADBIT(File$, KgLoadBitReadOnly%, bitmaps%)
      bitmap$ = PARSE$(".", File$, p%()) + RIGHT$("000" + NUM$(bitmaps%,3),3) + ".mbm"
      gSAVEBIT bitmap$
      PRINT "Extracted bitmap", bitmap$, NUM$(gWIDTH,4)+" x "+NUM$(gHEIGHT,4)
      gCLOSE bit%
      bitmaps%=bitmaps%+1
   ENDWH
End::
   ONERR OFF
   IF bitmaps%
   ELSE
      PRINT "Error extracting file!!!"
   ENDIF
   RETURN bitmaps%
ENDP


Last edited by Edo on Thu Sep 22, 2005 12:04 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Jonas



Joined: 10 Aug 2005
Posts: 74


Location: Stuttgart, Germany

PostPosted: Thu Sep 22, 2005 11:42 am    Post subject: Reply with quote

Thanks for sharing it to us! Will try this out tonight Smile
Test:
Code:
PROC HilfeEnglisch:
   dINIT "Help",1 or 2
   dTEXT "","-=FUN-MODE=-",0
   dTEXT "","Press [l] to set the LED on and [k] to set it off.",0
   dTEXT "","With any other KeyPress it will set the LED on and off fast.",0
   dTEXT "","Press [e] to come to the Menu. Try out [F] also",0 or $200
   dTEXT "","-=MORSE-MODE=-",0
   dTEXT "","Press a Key from A-Z and you will get the Morse-Code as",0
   dTEXT "","Blinking or Beeping (Set in Options). Quit the Macro with",0
   dTEXT "","a KeyPress like [Esc] !",0 or $200
   dTEXT "","                  http://boni.de.ms                     ",0
   dTEXT "","   'LED' is a Macro written by Jonas Bark. For any Tips",0
   dTEXT "","      please send an E-M@il to <jonas.bark@gmx.de>",0
   dBUTTONS "Back",13 or $100 or $200,"Quit",27 or $100 or $200
   IF DIALOG=13
      
   ELSE
   ENDIF
ENDP


Ah well, Edo, use [*code] Your source code [*/code] for displaying it with indentions Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Edo



Joined: 10 Aug 2005
Posts: 390


Location: Prismen - Vis

PostPosted: Thu Sep 22, 2005 12:09 pm    Post subject: Reply with quote

Jonas wrote:
Thanks for sharing it to us! Will try this out tonight Smile
Ah well, Edo, use [*code] Your source code [*/code] for displaying it with indentions Wink


Thanks, Jonas Wink
It's edited!
Haven't been posting code before Laughing

Edo


Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    View+ Forum Index -> ER5 OPL corner All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Create your own free forum | Buy a domain to use with your forum
Free Web Counter