Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-10-2008, 03:52 PM   #10
Playbahnosh
The Peacemaker
 
Playbahnosh's Avatar


 
Join Date: Apr 2005
Location: Veszprem, Hungary
Posts: 353
Send a message via MSN to Playbahnosh
Default

Okay, using _r.u.s.s.' idea, I created another pseudo-code, which replaces the timecodes instead of the subtitles themselves. Here:

Code:
OPEN file
X=0
IF search string "-->" returns result
   THEN:
       move pointer to location
       record line to variable T1
       delete line
       insert "00:00:00,000 --> 00:00:00,001"
       go down one line
   ELSE:
      msg: "Wrong file"
      END PROGRAM
END IF
REPEAT UNTIL X=1
   IF search string "-->" returns result
      THEN:
         move pointer to location
         record line to variable T2
         delete line
         insert line from variable T1
         move down one line
            IF search string "-->" returns result
               THEN:
                  move pointer to location
                  record line to variable T1
                  delete line
                  insert line from variable T2
                  move down one line
               ELSE:
                  X=1
            END IF
      ELSE:
         X=1
   END IF
END
SAVE file
CLOSE file
msg: "finished"
END PROGRAM
This is inarguably an easier method, and should be a cakewalk to put together, now.

Because the, fist line's timecode will be used as the second and the second's as the third...etc, I inserted a dummy timecode to the first line. By later deleting that line in-program, the indexing problem will be solved too.

A little help here?
__________________
The Master of Light and Darkness

"Don't fight the bad things in life! Find the good one! They are everywhere! Don't spend your life fighting for goals you can never reach! Live for the moment!"


BEWARE: I'm using the forums as a personal blog!
Playbahnosh is offline                         Send a private message to Playbahnosh
Reply With Quote
 


Similar Threads
Thread Thread Starter Forum Replies Last Post
Castlevania movie script revealed TheChosen Blah, blah, blah... 16 18-07-2008 06:41 PM
Abandonia Script? jourdan Old Suggestions 4 09-07-2007 09:24 AM
Script Not Working After Migrate Reup Old Suggestions 1 25-08-2006 11:58 AM
Annoying Script Prompt -RESOLVED guesst Old Suggestions 7 28-07-2006 01:00 AM


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 09:35 PM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.