Results 1 to 6 of 6

Thread: Help me using Lua function

  1. #1
    Join Date
    Aug 2002
    Location
    Geneva
    Posts
    97

    Default Help me using Lua function

    Hi everybody,

    So far I was using GVMS with the following functions to get WinAMP song titles, but since I switched for the 3.2.5 version, they don't work anymore.

    Could anybody kindly help me by translating them in the new language since I am a really bad programmer and didn't figure out how to do it


    Those functions are:

    Track=cut(Track, substr(Track,". ",0)+2, substr(Track," - Winamp",0)-3);

    and

    TrackPos = format("%d",TrackPosM)+":"+format("%.2d",TrackPosS );

    Sorry, I don't even understand what those funtions stand for...

    Lastly how can I delete a variable, it was pretty easy using GVMS since it was simply delete variable, but in Lua I don't know how to do it.

    Thanks.

  2. #2
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,350

    Default

    Here are the translated statements:

    Code:
    Track = strsub(Track, strfind(Track,".")+3, strfind(Track, " - Winamp") - 3)
    TrackPos = format("%d:%.2d", TrackPosM, TrackPosS)
    Please consult the manuals for the explanations of these functions.
    Ron
    No support through PM

  3. #3
    Join Date
    Aug 2002
    Location
    Geneva
    Posts
    97

    Default

    Thanks Ron,

    I read the entire manual yesterday but couldn't find how to delete a variable, so is it simply possible to do so?

    Cheers.

  4. #4
    Join Date
    Feb 2001
    Location
    Plano, TX, USA
    Posts
    3,055

    Default

    I don't know of a function used to delete variables in LUA.

    LUA supports the concept of local variables, though. These variables have the scope of the current routine or block and are automatically deleted when the current routine or block is exited. Example -
    Code:
    local Var1
    Var1 = 3
    print(Var1)
    Var1 = "help me"
    print(Var1)
    Run this code from the script editor and you should get the results -
    3
    help me

    Script finished.
    Return value=0

    Open the variable window and Var1 will NOT be present as it was already deleted.

    I don't know if a local variable will work for your particular case but I thought I'd mention it.
    Mark F

  5. #5
    Join Date
    Oct 2001
    Location
    Bulgaria
    Posts
    270

    Default

    This is the way to delete a global variable
    Code:
    VarName = nill

  6. #6
    Join Date
    Aug 2002
    Location
    Geneva
    Posts
    97

    Default

    Thanks for that man!

Posting Permissions

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