Results 1 to 3 of 3

How to make the script a bit, Adaptive.

Threaded View

  1. #1
    Registered User
    Join Date
    06-08-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2013
    Posts
    20

    How to make the script a bit, Adaptive.

    Canīt think of a topic, but it pretty much has to do with having the script adapt to things.
    May sound hard, but itīs a very simple thing i want it to adapt to.

    The part i want to enhance is this:

    avs2 = "Avisource(""" & Replace(ActiveWorkbook.FullName, ".csv", ".avi") & """).GetChannels(1,1).ConvertToMono()" & ".DelayAudio(-0.0" & Replace(TextBox4.Value, ".", "") & ").SyncAudio(" & TextBox1.Value & ")"

    Specifically: ".DelayAudio(-0.0" & Replace(TextBox4.Value, ".", "")


    Now it may seem a mess, but just ignore all the code itself, it has to do with Avisynth which is another Script language.

    The only thing i want to enhance is DelayAudio.


    As you can see, i simple write .DelayAudio(-0.0(texbox)) , The textbox will be something like 63.353223 etc.

    This works all fine, as long as the textbox (the value) is only xx.xxxx.... If itīs 3 numbers, the thing breaks, xxx.xxxxx....

    Why is because i have only made the code work with 2 digits, hence the "-0.0" , it simply means i only want to use a value under 100.
    Normally it isnīt a problem as the value shouldnīt be above 100.

    But when it is, it wonīt work, it will write it as a 2 digit.
    For example:

    44.2222 will be 44.2222 milliseconds, nothing wrong there.
    But
    121.2323 will become 12.12323 milliseconds, which is way off.


    So i want it to adapt. If the value is xx. write -0.0(...), if the value is xxx. write -0.(...).


    I think i made a total mess of my explanation, please ask if there is something you donīt understand.


    I myself am thinking of something pretty easy, like:

    If there is 2 number before . write -0.0, if there is 3, -0. , if 4 -
    Something like that.
    Will look pretty ugly, but should be simple to implement i think.
    Many Thanks!
    Last edited by zerowalker; 10-01-2013 at 12:59 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Adaptive cell range
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2013, 11:34 AM
  2. Adaptive Custom Message Box
    By paxile2k in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-23-2010, 08:33 PM
  3. Adaptive image viewing
    By nani in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2010, 01:10 PM
  4. Make A Script Repeat
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-23-2008, 04:42 PM
  5. Forcing adaptive menu options
    By Wowbagger in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 12-12-2005, 11:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1