Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jun 2008
    Posts
    182

    How to add this?

    I have :

    Bentley = C:\\WINDOWS\\system32\\

    I want

    Bentley = "C:\\WINDOWS\\system32\\"

    this won't work
    Bentley = ""C:\\WINDOWS\\system32\\""

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    Try -

    Code:
    Bentley = \"C:\\WINDOWS\\system32\\\"

  3. #3
    Join Date
    Feb 2010
    Posts
    25
    You might want to take a look at the Global Variables:
    _SystemFolder, _WindowsFolder, etc.

  4. #4
    Join Date
    Jun 2008
    Posts
    182
    Thanks guys

  5. #5
    Join Date
    Jun 2008
    Posts
    182
    Cool, but if I have a variable, how would that work?


    Var = C:\\WINDOWS\\system32

    Bentley = \"..Var..\\\" ??? Will this work?

  6. #6
    Join Date
    Feb 2010
    Posts
    25
    Use _SystemFolder as-is:
    Code:
    Bentley = _SystemFolder;
    exeFile = "cmd.exe";
    pathToExeFile = Bentley .. "\\" .. exeFile;
    Shell.Execute (pathToExeFile, "open", "", "", SW_SHOWNORMAL, false);
    Or just:
    Code:
    exeFile = "cmd.exe";
    pathToExeFile = _SystemFolder .. "\\" .. exeFile;
    Shell.Execute (pathToExeFile, "open", "", "", SW_SHOWNORMAL, false);

  7. #7
    Join Date
    Jun 2008
    Posts
    182
    Thanks, but that path is just a sample:

    Here is the actual script:
    for x = 1,4 do

    Sound = XML.GetValue(strXMLPath.."/audioanswer"..x.."");
    AudiA = (WereAreThow..Sound)

    Button.SetProperties("Answer"..x,{ClickSound=2});
    Button.SetProperties("Answer"..x,{ClickSoundFile= AudiA});

    You see AudiA needs the "" , so how do I get the content of AudiA between " "

  8. #8
    Join Date
    Aug 2003
    Posts
    2,427
    In general terms when you want to include a control character e.g. / or " etc in a string, then you need to escape it. To do so you precede it with \

  9. #9
    Join Date
    Jun 2008
    Posts
    182
    AudiA = "\"..AudiA.."\" Like this?

  10. #10
    Join Date
    Jun 2008
    Posts
    182
    Thanks, worked it out:

    AudiA = "\""..AudiA.."\""

    !!!

  11. #11
    Join Date
    Aug 2003
    Posts
    2,427
    Do it within your concatenation. Say I was setting the text for a label then -

    Code:
    txt = "Something"
    Label.SetText("Label1", "\""..txt.."\"");
    p.s. -- Oh right - too late

  12. #12
    Join Date
    Jun 2008
    Posts
    182
    I need help!!!!! Nothing wants to work today!!!!
    for x = 1,4 do
    AnswerD = "Answer"..x..""
    Answer = "\""..AnswerD.."\""
    Bentley = \"C:\\WINDOWS\\system32\\wowsound\\\"


    Button.SetProperties(Answer,{ClickSound="2"}); Button.SetProperties(Answer,{ClickSoundFile=Bentle y});

    WON"T WORK AT ALL!!!!!!!!
    PLEASE>>>>>

  13. #13
    Join Date
    Feb 2010
    Posts
    25
    Why don't you post you project?

    Hard to make out what is going on with partial code.

  14. #14
    Join Date
    Jun 2008
    Posts
    182
    All I want to do is change a buttons "on click sound" in the form of a variable:

    for x = 1,4 do
    AnswerD = "Answer"..x..""
    Answer = "\""..AnswerD.."\""
    Bentley = \"C:\\WINDOWS\\system32\\wowsound\\sound.wav\\\ "

    Not Working:
    Button.SetProperties(Answer,{ClickSound="2"});
    Button.SetProperties(Answer,{ClickSoundFile= Bentley});

    Working:
    Button.SetProperties("Answer1",{ClickSound="2"});
    Button.SetProperties("Answer1",{ClickSoundFile=""C :\\WINDOWS\\system32\\wowsound\\sound.wav"});

    Works? Why
    Last edited by ronwilliams; 03-08-2010 at 05:18 AM.

  15. #15
    Join Date
    Feb 2010
    Posts
    25
    Why so complicated (and syntatically-incorrect)
    Code:
    Bentley = \"C:\\WINDOWS\\system32\\wowsound\\sound.wav\\\ "
    ??
    ~ You cannot have a \ before the "
    ~ you cannot have \\\
    When you try this the complier says so!

    Just use
    Code:
    Bentley = _SystemFolder .. "\\wowsound\\sound.wav"

Posting Permissions

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