SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cold fusion and calling VBSCRIPT DLL

    I execute following code snippet, but getting an null exception error.

    <cfset xy="(J|j;|&#x4A;|&##x6A(A|a;|&##x41;|&##x61(V|v;|&##x56;|&##x76(A|a;|&##x41;|&##x61(S|s;|&##x53;|&##x73(C|c;|&##x43;|&##x63(T|t;|&##x54;|&##x74;|&##x3A|">
    <cfobject action = "Create"
    type = "COM"
    class = "VBScript.RegExp"
    name = "objRegEx">
    <cfset objRegEx.Global = True >
    <cfset objRegEx.IgnoreCase = True>
    <cfset objRegEx.Pattern = #xy#>
    <cfset objRegEx.test('test')>


    I am getting an error for line <cfset objRegEx.test('test')>. I am calling Vbscript regexp expression from cold fusion. is this doable?

    Error: An exception occurred when executing a Com method.
    The cause of this exception was that: java.lang.NullPointerException.

    The error occurred in D:\Project Area\equote\web\theft\doform.cfm: line 71

    69 : <cfset objRegEx.IgnoreCase = True>
    70 : <cfset objRegEx.Pattern = #xy#>
    71 : <cfset objRegEx.test('test')>
    72 :
    73 :



    Let me know what is wrong in my code? Also confirm is it okay if i call sbscript component regexp from cold fusion? It is fail when program tried to execute code objRegEx.test('test').

    Let me know if anybody have any idea.

    Thanks
    Amar Powar



    thanks
    amar powar

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just curious, but why are you calling a VB class just to use a regular expression? ColdFusion has a built in RegEx engine:

    http://www.cfquickdocs.com/cf8/#cat:...egories:String

    You're looking for these methods:
    REFind
    REFindNoCase
    REMatch
    REMatchNoCase
    REReplace
    REReplaceNoCase
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have pattern which has been written in VBSCRIPT. I don't want to waste my time converting to cold fusion. so just want to use as it is.

    if there is no way to call regexp then I will go for coversion, just want to confrim from masters.

    Thanks in advance


    Thanks
    Amar Powar

  4. #4
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by amarpowar View Post
    I have pattern which has been written in VBSCRIPT. I don't want to waste my time converting to cold fusion. so just want to use as it is.

    if there is no way to call regexp then I will go for coversion, just want to confrim from masters.

    Thanks in advance


    Thanks
    Amar Powar
    I think VBscript dll is not true com based dll , hence I could not execute function test of VBSCRIPT.REGEXP component.

    I decided to convert pattern matching string to CFM pattern matching.


Bookmarks

Posting Permissions

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