Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    182

    How can this be?!?!?

    I have:
    A1 = XML.GetValue(strXMLPath.."/audio1")
    A2 = XML.GetValue(strXMLPath.."/audio2")
    A3 = XML.GetValue(strXMLPath.."/audio3")
    A4 = XML.GetValue(strXMLPath.."/audio4")

    for x = 1,4 do
    AudiClip = "A"..x..""

    soo.....AudiClip will be A1 or A2 or A3

    Now
    btn = Dialog.Message("Selected Audio is:", AudiClip , MB_RETRYCANCEL);
    Which gives Selected Audio is: A1
    I want the A1 path instead c:\audio\F How?

  2. #2
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Quote Originally Posted by ronwilliams View Post
    I have:
    A1 = XML.GetValue(strXMLPath.."/audio1")
    A2 = XML.GetValue(strXMLPath.."/audio2")
    A3 = XML.GetValue(strXMLPath.."/audio3")
    A4 = XML.GetValue(strXMLPath.."/audio4")

    for x = 1,4 do
    AudiClip = "A"..x..""

    soo.....AudiClip will be A1 or A2 or A3

    Now
    btn = Dialog.Message("Selected Audio is:", AudiClip , MB_RETRYCANCEL);
    Which gives Selected Audio is: A1
    I want the A1 path instead c:\audio\F How?
    Variables do not work like this in Lua.

    I'm not sure I understand what you want either.

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    A table is the best way to do something like that.

    Code:
    local A = {}
    A[1] = XML.GetValue(strXMLPath.."/audio1")
    A[2] = XML.GetValue(strXMLPath.."/audio2")
    A[3] = XML.GetValue(strXMLPath.."/audio3")
    A[4] = XML.GetValue(strXMLPath.."/audio4")
    
    for x = 1,4 do
        AudiClip = A[x]
        -- "Do what ever"
    end
    Dermot

    I am so out of here

  4. #4
    Join Date
    Jun 2008
    Posts
    182
    Thanks, that makes sense! One more problem for me:

    I have a path
    C:\WINDOWS\system32\1029\Sound\Tree\1\wind.wav

    I need it in format

    "C:\\WINDOWS\\system32\\1029\\Sound\\Tree\\1\\wind .wav"

    Easiest way to achieve this??
    Thanks

    Ron

  5. #5
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    sPath = [[C:\WINDOWS\system32\1029\Sound\Tree\1\wind.wav]];

    sFormattedPath = String.Replace(sPath, "\\", "\\\\", false);
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

Posting Permissions

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