Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Posts
    5,380

    Detect Special Character ??

    i need a way of detecting a special character in a string of text

    eg:

    i have a mp3 file with the name "Sweet Family Attitude - 8 Days A Week (10° Below Vs X.Men-Mix).mp3", the char marked in red is the troublesome one

    it seems that my audio engine dosent like special character, it will not play the file or read its id3 tags and i get a error report from the ocx i am useing saying "invalid file", but if i change the name or remove the special char then it works ok but i want to be able to track the fault in the invalid file and inform the user to change the filename (or remove special char)

    any ideas or pointers
    Open your eyes to Narcissism, Don't let her destroy your life!!

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    You can search for extended characters by using its ASCII value.



    if String.Find(MP3Name, "\248") ~= -1 then
    --found a bad character
    end

  3. #3
    Join Date
    Jul 2002
    Location
    Just South of Reality
    Posts
    778
    Rizla
    This is pretty lame, but it works...
    just editted ranges of ascii characters.

    Code:
    s1 = Input.GetText("Input1")
    s2=""
    sLen = String.Length(s1)
    for x = 1, sLen do
    	if (String.Mid(s1, x, 1)) == " " or 
    		(String.Mid(s1, x, 1)) == "." or 
    		(String.Mid(s1, x, 1)) == "-" or
    		((String.Mid(s1, x, 1)) > "/" and (String.Mid(s1, x, 1)) < ":") or
    		((String.Mid(s1, x, 1)) > "@" and (String.Mid(s1, x, 1)) < "[") or
    		((String.Mid(s1, x, 1)) > "`" and (String.Mid(s1, x, 1)) < "{")  
    	then
    
    	    s2=s2 .. String.Mid(s1,x,1)
    	else
    		s2=s2 .. "-"
    	end
    end
    
    Input.SetText("Input2", s2)
    Last edited by holtgrewe; 03-28-2008 at 01:47 PM.

  4. #4
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Riz,

    I suggest u use the LUA regex to detect all sorts of special characters.
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    thanks guys, i was hoping there was a easy way or ready made dll to catch all special chrs.

    guess i'll have to get busy then, think ill make a dll, for reuseabilty in other apps


    EDIT:

    I suggest u use the LUA regex to detect all sorts of special characters.
    iv been lead to beleave regex is a little complecated, i think i will have a quick research on the subject and see what i can do
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. Function: Filter Key Press for On Key Event
    By Worm in forum AutoPlay Media Studio 7.5 Examples
    Replies: 17
    Last Post: 01-25-2008, 04:54 AM
  2. detect Acrobat Reader version dynamically
    By andrewr in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 05-20-2005, 08:24 AM
  3. Special character question
    By Larry Singer in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 10-26-2004, 02:47 AM
  4. DOS commands
    By John_Klassek in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 09-16-2004, 08:48 AM
  5. Q with detect acrobat and reader
    By lorenhsu1128 in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 04-21-2004, 06:48 PM

Posting Permissions

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