Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137

    Character Classes in AMS 5?

    How can a user duplicate Character Classes in AMS 5 like those used in PHP 5?

    I looked at the following page to try and find the equivalent in AMS 5:

    http://www.lua.org/pil/20.2.html (seeing how LUA is Embedded into AMS 5)

    Here is a very simple example of what I want to do:

    Code:
    num = 5;
    
    if num == "1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or 0" then -- I want something more like [0-9] to minimize the code
         Dialog.Message("", "Found a match!");
    else
         Dialog.Message("", "Sorry, no match");
    end
    I thought I had seen the solution before in the forums here... but alas... it seems that post has gone to the big code grave in the sky.

    Any ideas?

    Thanks in advance,
    Last edited by Intrigued; 10-10-2004 at 04:28 PM.
    Intrigued

  2. #2
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    I checked one page before the link I posted above and found this at the top of the page. I hope that does not mean what I think it means (no shorter way to accomplish such in LUA thus in AMS 5).

    Here's the paragraph that is close to the top of the page:
    Unlike several other scripting languages, Lua does not use POSIX regular expressions (regexp) for pattern matching. The main reason for this is size: A typical implementation of POSIX regexp takes more than 4,000 lines of code. This is bigger than all Lua standard libraries together. In comparison, the implementation of pattern matching in Lua has less than 500 lines. Of course, the pattern matching in Lua cannot do all that a full POSIX implementation does. Nevertheless, pattern matching in Lua is a powerful tool and includes some features that are difficult to match with standard POSIX implementations.
    Intrigued

  3. #3
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    if String.TrimLeft(n,"0123456789") == "" then
    --the variable n was numeric 0-9
    end

    But that would be true for any string that contained any combination of the above characters.

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    So, my understanding of Character Classes must be accurate with regards to this endeavor it seems? It would be nice to have access to the (preferred) method I code-commented about in my prior post;however, Worm, thanks for your help nontheless. It will come in handy!

    Sincerely,
    Intrigued

  5. #5
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Update:

    Solution found and an example created!

    http://www.indigorose.com/forums/sho...7846#post67846

    It's more aptly called, I found, Character Range(s). That link above goes to a post where I have also created a little example. Forum TJ_Tigger gets the credit on finding this gem a ways back. I just wanted to add a note to this post incase I or anyone else comes upon it again.

    Intrigued

Similar Threads

  1. Easy ActiveX/COM use for AMS
    By SRJ in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 09-07-2004, 05:05 PM
  2. Dual Format AMS autorun CD/VCD
    By tviman in forum AutoPlay Media Studio 5.0
    Replies: 9
    Last Post: 04-12-2004, 02:20 PM
  3. Pop-up window in AMS 5
    By Lee_Benson in forum AutoPlay Media Studio 5.0
    Replies: 9
    Last Post: 12-25-2003, 06:43 AM
  4. Can you "embed" apps within AMS?
    By jbarr in forum AutoPlay Media Studio 4.0
    Replies: 6
    Last Post: 12-01-2003, 08:08 AM
  5. (( Right Click Properties Version infomation
    By GraphiX2003 in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 02-10-2003, 01:15 AM

Posting Permissions

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