Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 15 of 15
  1. #1
    Join Date
    Mar 2006
    Posts
    17

    How can i use (")

    Hello
    How can i use the " in my scripts for eample i want to use " in my message text
    thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Maine, USA
    Posts
    1,695
    Preceed it with a slash \"

  3. #3
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Or,

    Code:
    'They said, "hello all!", can you believe that?'
    Intrigued

  4. #4
    Join Date
    Jan 2000
    Posts
    2,002
    or:

    Code:
    strText = [[And I said, "Hello"!]];

  5. #5
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    or...
    Code:
    Dialog.Message("", "''Hey you!  STOP!''")
    Intrigued

  6. #6
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Quote Originally Posted by Brett
    or:

    Code:
    strText = [[And I said, "Hello"!]];
    Also...

    This brings up a "bug"?

    The bracks are all colored red, save for one. (second to last one)

    That was a bug a ways back wasn't it?
    Intrigued

  7. #7
    Join Date
    Nov 2005
    Location
    Banned by moderator.
    Posts
    264
    yeah, the last one is black...

  8. #8
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    -- \### represents the ASCII character
    strText = "Worm says, \034Hello\034";
    Last edited by Worm; 03-18-2006 at 03:55 AM.

  9. #9
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Code:
    function quoteText(strText)
       return (String.Replace(strText, "'", "\"", false));
    end
    
    Dialog.Message("A message for you:", quoteText("Corey says 'Hello!'"));

  10. #10
    Join Date
    Mar 2006
    Posts
    17
    Thanks a lot

  11. #11
    Join Date
    Mar 2006
    Posts
    17
    what caracter can i use instead of "\\" ?
    thanks

  12. #12
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    All showing off aside, the best way to use a quote is to simply escape it with a slash. so anywhere you want a quotation mark in the string just proceed it with a backslash, the backslash will not show up in your string when you use it...

  13. #13
    Join Date
    Mar 2006
    Posts
    17
    oh no but i want to use a file address in the listbox (in ItemData) for example i get the address with the Dialog.FileBrowse and save the address in a LUA file for example i get this address :
    C:\Track1.mp3
    but this address is showed in ams:
    C:Track1.mp3
    what can i do for this?

  14. #14
    Join Date
    Mar 2005
    Posts
    130
    C:\\Track1.mp3
    aplly for all subdirectories
    like
    C:\\my folder\\my folder 2\\my file.bin

  15. #15
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    Quote Originally Posted by Khattat
    oh no but i want to use a file address in the listbox (in ItemData) for example i get the address with the Dialog.FileBrowse and save the address in a LUA file for example i get this address :
    C:\Track1.mp3
    but this address is showed in ams:
    C:Track1.mp3
    what can i do for this?
    One thing you could do is use the String.SplitPath action to separate the path returned by your Dialog.FileBrowse() into it's components and then include the extra "\" in a concat before display to the user.

    Something like this:

    Code:
    -- Collect the list of files from the user
    t_ReturnedFiles = {};
    t_ReturnedFiles = Dialog.FileBrowse(true, "Open File", _ProgramFilesFolder, "Text File (*.txt)|*.txt|All Files(*.*)|*.*|", "", "", false, false);
    
    -- Step through the list of returned files splitting each into its path parts
    -- i.e. "C:\My Document\pic.jpg" --> "C:\", "My Documents\", "pic.jpg"
    for index_ReturnedFiles, string_ReturnedFiles in t_Files do
         t_PathParts = {};
         t_PathParts = String.SplitPath(string_ReturnedFiles);
         
         -- Now reassemble the separate parts adding the extra slashes
         -- i.e. "C:\\My Documents\\pic.jpg\"  (AMS should ignore the last slash)
         for index_PathParts, string_PathParts in t_PathParts do
              string_ReturnedFiles = "";
              String.Concat(string_ReturnedFiles, string_PathParts.."\");
         end
    end
    
    -- This should leave you with a t_ReturnedFiles table that contains
    -- file path strings with doubled slashes
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

Posting Permissions

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