creating your own functions in cold fusion

2000-08-14 Thread Paul Johnston

There was an email (either here or fusebox list) about creating your own
functions in cold fusion.  Does anyone know where the article explaining it
is because I have moved jobs and lost all my archives of CF-Talk.

Thanks

Paul


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-02 Thread Vance_Duke


How about IsSocial to determine if the number is a Social Security Number.


Vance Duke
Cold Fusion Application Developer
x4729



   

"Michael   

Dinowitz"To: [EMAIL PROTECTED]   

mdinowit@i-2cc:   

000.com Subject: Re: Functions in Cold Fusion 

   

08/01/00   

12:10 PM   

Please 

respond to 

cf-talk

   

   




OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others
to
'add in'. I'd like the article to have a few pre-built functions that can
be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

- Original Message -
From: "Michael Dinowitz" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 12:42 PM
Subject: Re: Functions in Cold Fusion


 I'm currently writing an article for the next Fusion Authority (out in
the
 next day) on how to write and use custom functions in CF. This is not
using
 modules or any CF tags but is actually using function calls. It's a bit
of
a
 hack and can look ugly in places, but it works. The result is that I can
 have something like IsValidEmail(email) and it'll return a value that
says
 yes or no.


--

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.




--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Functions in Cold Fusion

2000-08-01 Thread Brandon Behrens

This is a multi-part message in MIME format.

--=_NextPart_000_0016_01BFFBA4.BF744660
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by bastion.theidf.com id 
e71FbrJ27627

Hello everyone,

This may seem like a rookie question, but I cannot figure out a way to ma=
ke
my own function in Cold Fusion.  Am I missing something?  I have been
working with it for a month and haven=92t seen anything about it.  Can I =
make
calls to a Java class or something like that?

Thanks in advance,

Brandon Behrens

Brandon Behrens
The Internet Design Firm
512.451.5225
[EMAIL PROTECTED]
http://www.theidf.com


--=_NextPart_000_0016_01BFFBA4.BF744660
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40"

head
meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"
meta name=3DProgId content=3DWord.Document
meta name=3DGenerator content=3D"Microsoft Word 9"
meta name=3DOriginator content=3D"Microsoft Word 9"
link rel=3DFile-List href=3D"cid:[EMAIL PROTECTED]"
!--[if gte mso 9]xml
 o:OfficeDocumentSettings
  o:DoNotRelyOnCSS/
 /o:OfficeDocumentSettings
/xml![endif]--!--[if gte mso 9]xml
 w:WordDocument
  w:ViewNormal/w:View
  w:Zoom0/w:Zoom
  w:DocumentKindDocumentEmail/w:DocumentKind
  w:EnvelopeVis/
 /w:WordDocument
/xml![endif]--
style
!--
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
span.EmailStyle15
{mso-style-type:personal-compose;
mso-ansi-font-size:11.0pt;
mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";
mso-bidi-font-family:Arial;
color:black;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
--
/style
/head

body lang=3DEN-US style=3D'tab-interval:.5in'

div class=3DSection1

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'Hello
everyone,o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'![if =
!supportEmptyParas]nbsp;![endif]o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'This
may seem like a rookie question, but I cannot figure out a way to make =
my own
function in Cold Fusion.span style=3D"mso-spacerun: yes"nbsp; =
/spanAm I
missing something?span style=3D"mso-spacerun: yes"nbsp; /spanI have =
been
working with it for a month and haven#8217;t seen anything about =
it.span
style=3D"mso-spacerun: yes"nbsp; /spanCan I make calls to a Java =
class or
something like that?o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'![if =
!supportEmptyParas]nbsp;![endif]o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'Thanks
in advance,o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'![if =
!supportEmptyParas]nbsp;![endif]o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'Brandon
Behrenso:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'![if =
!supportEmptyParas]nbsp;![endif]o:p/o:p/span/font/span/p

p class=3DMsoAutoSig!--[if supportFields]font color=3Dblackspan=20
style=3D'color:black'span =
style=3D'mso-element:field-begin'/spanspan=20
style=3D"mso-spacerun: yes"nbsp;/spanAUTOTEXTLIST \s quot;E-mail=20
Signaturequot; span =

RE: Functions in Cold Fusion

2000-08-01 Thread Jeremy Allen

Currently.. as a language that is one of ColdFusions weaknesses.


There are pretty much two ways to get functions out of ColdFusion..
The first is to encapsulate all the code in a Template and then
just CFINCLUDE the template.. the disadvantage is the page
does not have its own scope and can easily modify variables
that do not belong to it and kind of makes development more
tedious if you are not extremely careful.

The second method is Custom Tags.. Which in effect serve
as functions and get their own 'call space' all the variables
in a custom tag have their own scope etc, however doing
a call with a Custom Tag is a bigger penality hit than
a regular function in a regular procedural language
sucha s C/C++.. In fact its a big concern if performance
is an issue.

If you are really interested I recommend checking out the
Fusebox methodology as code reuse can be pretty high in a
big app written in Fusebox..

http://www.fusebox.com


Hope this helps..



Jeremy Allen
[EMAIL PROTECTED]
[Insert cool title here]

-Original Message-
From: Brandon Behrens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 1:39 PM
To: Cf-Talk@Houseoffusion. Com
Subject: Functions in Cold Fusion


This is a multi-part message in MIME format.

--=_NextPart_000_0016_01BFFBA4.BF744660
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by bastion.theidf.com id
e71FbrJ27627

Hello everyone,

This may seem like a rookie question, but I cannot figure out a way to ma=
ke
my own function in Cold Fusion.  Am I missing something?  I have been
working with it for a month and haven=92t seen anything about it.  Can I =
make
calls to a Java class or something like that?

Thanks in advance,

Brandon Behrens

Brandon Behrens
The Internet Design Firm
512.451.5225
[EMAIL PROTECTED]
http://www.theidf.com


--=_NextPart_000_0016_01BFFBA4.BF744660
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40"

head
meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"
meta name=3DProgId content=3DWord.Document
meta name=3DGenerator content=3D"Microsoft Word 9"
meta name=3DOriginator content=3D"Microsoft Word 9"
link rel=3DFile-List href=3D"cid:[EMAIL PROTECTED]"
!--[if gte mso 9]xml
 o:OfficeDocumentSettings
  o:DoNotRelyOnCSS/
 /o:OfficeDocumentSettings
/xml![endif]--!--[if gte mso 9]xml
 w:WordDocument
  w:ViewNormal/w:View
  w:Zoom0/w:Zoom
  w:DocumentKindDocumentEmail/w:DocumentKind
  w:EnvelopeVis/
 /w:WordDocument
/xml![endif]--
style
!--
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
span.EmailStyle15
{mso-style-type:personal-compose;
mso-ansi-font-size:11.0pt;
mso-ascii-font-family:"Times New Roman";
mso-hansi-font-family:"Times New Roman";
mso-bidi-font-family:Arial;
color:black;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
--
/style
/head

body lang=3DEN-US style=3D'tab-interval:.5in'

div class=3DSection1

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'Hello
everyone,o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'![if =
!supportEmptyParas]nbsp;![endif]o:p/o:p/span/font/span/p

p class=3DMsoNormalspan class=3DEmailStyle15font size=3D2 =
color=3Dblack
face=3D"Times New Roman"span =
style=3D'font-size:11.0pt;mso-bidi-font-size:12.0pt'This
may seem like a rookie question, but I cannot figure out a way to make =
my own
function in Cold Fusion.span style=3D"mso-spacerun: yes"nbsp; =
/spanAm I
missing something?span style=3D"mso-spacerun: yes"nbsp; /spanI have =
been
working with it for a month and haven#8217;t seen anything about =
it.span
style=3D"mso-spac

Re: Functions in Cold Fusion

2000-08-01 Thread Sharon DiOrio

Cold Fusion doesn't have functions as you'd know them in Java.  It has the
built-in functions, of course.  Cold Fusion achieves "function functionality"
through custom tags.

Sharon

At 10:39 AM 8/1/2000 -0700, you wrote: 

 This is a multi-part message in MIME format.

 --=_NextPart_000_0016_01BFFBA4.BF744660
 Content-Type: text/plain;
 charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable
 X-MIME-Autoconverted: from 8bit to quoted-printable by bastion.theidf.com id
 e71FbrJ27627

 Hello everyone,

 This may seem like a rookie question, but I cannot figure out a way to ma=
 ke
 my own function in Cold Fusion.  Am I missing something?  I have been
 working with it for a month and haven=92t seen anything about it.  Can I =
 make
 calls to a Java class or something like that?

 Thanks in advance,

 Brandon Behrens

 Brandon Behrens
 The Internet Design Firm
 512.451.5225
 [EMAIL PROTECTED]
 http://www.theidf.com/http://www.theidf.com


 --=_NextPart_000_0016_01BFFBA4.BF744660
 Content-Type: text/html;
 charset="iso-8859-1"
 Content-Transfer-Encoding: quoted-printable

 xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
 xmlns=3D"http://www.w3.org/TR/REC-html40" 

 Hello everyone,

  

 This may seem like a rookie question, but I cannot figure out a way to
make =
 my own function in Cold Fusion.  = Am I missing something?  I have = been
 working with it for a month and haven t seen anything about = it.  Can I
make
 calls to a Java = class or something like that?

  

 Thanks in advance,

  

 Brandon Behrens

  

 Brandon Behrens

 The = Internet Design Firm

 512.451.= 5225

 brandon@= theidf.com

 http://w/http://w= ww.theidf.com

  = /p 


 --=_NextPart_000_0016_01BFFBA4.BF744660--

 --
 
 Archives:
 http://www.mail-archive.com/http://www.mail-archive.com/cf-talk@houseoff
 usion.com/
 To Unsubscribe visit

 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talkh
 ttp://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send
 a message to [EMAIL PROTECTED] with 'unsubscribe' in the
 body.




--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Michael Dinowitz

I'm currently writing an article for the next Fusion Authority (out in the
next day) on how to write and use custom functions in CF. This is not using
modules or any CF tags but is actually using function calls. It's a bit of a
hack and can look ugly in places, but it works. The result is that I can
have something like IsValidEmail(email) and it'll return a value that says
yes or no.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Brandon Behrens

Is there any way you could send me this article when you complete it?

Thanks,

Brandon

Brandon Behrens
The Internet Design Firm
512.451.5225
[EMAIL PROTECTED]
http://www.theidf.com

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 9:42 AM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion

I'm currently writing an article for the next Fusion Authority (out in the
next day) on how to write and use custom functions in CF. This is not using
modules or any CF tags but is actually using function calls. It's a bit of a
hack and can look ugly in places, but it works. The result is that I can
have something like IsValidEmail(email) and it'll return a value that says
yes or no.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Michael Dinowitz

Fusion Authority is sent by email to all subscribers and is archived on the
FA site. Signup and past issues can be seen at
www.fusionauthority.com/alert. You'll be able to get it from there (probably
tonight). I'm testing out the code and techniques now and I've got to say
its very cool.

 Is there any way you could send me this article when you complete it?

 Thanks,

 Brandon

 Brandon Behrens
 The Internet Design Firm
 512.451.5225
 [EMAIL PROTECTED]
 http://www.theidf.com

 -Original Message-
 From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 01, 2000 9:42 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Functions in Cold Fusion

 I'm currently writing an article for the next Fusion Authority (out in the
 next day) on how to write and use custom functions in CF. This is not
using
 modules or any CF tags but is actually using function calls. It's a bit of
a
 hack and can look ugly in places, but it works. The result is that I can
 have something like IsValidEmail(email) and it'll return a value that says
 yes or no.

 --
--
 --
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Michael Dinowitz

OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others to
'add in'. I'd like the article to have a few pre-built functions that can be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

- Original Message -
From: "Michael Dinowitz" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 12:42 PM
Subject: Re: Functions in Cold Fusion


 I'm currently writing an article for the next Fusion Authority (out in the
 next day) on how to write and use custom functions in CF. This is not
using
 modules or any CF tags but is actually using function calls. It's a bit of
a
 hack and can look ugly in places, but it works. The result is that I can
 have something like IsValidEmail(email) and it'll return a value that says
 yes or no.

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Brandon Behrens

How about isSocial, isZip

Brandon Behrens
The Internet Design Firm
512.451.5225
[EMAIL PROTECTED]
http://www.theidf.com

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 10:10 AM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion

OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others to
'add in'. I'd like the article to have a few pre-built functions that can be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

- Original Message -
From: "Michael Dinowitz" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 12:42 PM
Subject: Re: Functions in Cold Fusion


 I'm currently writing an article for the next Fusion Authority (out in the
 next day) on how to write and use custom functions in CF. This is not
using
 modules or any CF tags but is actually using function calls. It's a bit of
a
 hack and can look ugly in places, but it works. The result is that I can
 have something like IsValidEmail(email) and it'll return a value that says
 yes or no.

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Ken Wilson

 functions in CF. No tags. For example, IsPhone uses this code:
 REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)



Should that be named "IsUSAPhone" so as not to offend our illustrious
international friends?

Ken


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Jennifer

How about IsURL?

At 01:10 PM 8/1/00 -0400, you wrote:
OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others to
'add in'. I'd like the article to have a few pre-built functions that can be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

- Original Message -
From: "Michael Dinowitz" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 12:42 PM
Subject: Re: Functions in Cold Fusion


  I'm currently writing an article for the next Fusion Authority (out in the
  next day) on how to write and use custom functions in CF. This is not
using
  modules or any CF tags but is actually using function calls. It's a bit of
a
  hack and can look ugly in places, but it works. The result is that I can
  have something like IsValidEmail(email) and it'll return a value that says
  yes or no.
 
  --

  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
 

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or 
send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Michael Dinowitz

Very true. I've got a version that covers all phone numbers, but I was
giving a simple example. The point is, if you've got some snippets or code
that you would like in a custom function, send it to me off list.


  functions in CF. No tags. For example, IsPhone uses this code:
  REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)



 Should that be named "IsUSAPhone" so as not to offend our illustrious
 international friends?

 Ken


 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Nick Call

Another one, IsCreditCard

Nick

- Original Message -
From: "Brandon Behrens" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 1:00 PM
Subject: RE: Functions in Cold Fusion


 How about isSocial, isZip

 Brandon Behrens
 The Internet Design Firm
 512.451.5225
 [EMAIL PROTECTED]
 http://www.theidf.com

 -Original Message-
 From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, August 01, 2000 10:10 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Functions in Cold Fusion

 OK, I need some community input here. For my article on custom functions,
 I've written one for IsEmail and IsPhone. Can people send me a few others
to
 'add in'. I'd like the article to have a few pre-built functions that can
be
 used right off the bat. The only limits are that they must be built using
 functions in CF. No tags. For example, IsPhone uses this code:
 REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

 - Original Message -
 From: "Michael Dinowitz" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, August 01, 2000 12:42 PM
 Subject: Re: Functions in Cold Fusion


  I'm currently writing an article for the next Fusion Authority (out in
the
  next day) on how to write and use custom functions in CF. This is not
 using
  modules or any CF tags but is actually using function calls. It's a bit
of
 a
  hack and can look ugly in places, but it works. The result is that I can
  have something like IsValidEmail(email) and it'll return a value that
says
  yes or no.
 

 --
 
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
 

 --
--
 --
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Rick Osborne

(A bit tongue-in-cheek for a second, here.)

Have you seen a good regex for validating URLs lately?  It's *nasty*.  See:

http://www.foad.org/~abigail/Perl/url2.html

Or, if you're the type of person who skips to the end, the regex can be
found here:

http://www.foad.org/~abigail/Perl/url3.regex

It's a bit more than 7500 characters long.  :)  However, I think that it
would make an *excellent* test of CF's regex engine.  Of course you'd have
to translate from perl-style regexs to CF-style regexs, but it should be
possible.

-R

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 1:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion


How about IsURL?

At 01:10 PM 8/1/00 -0400, you wrote:
OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others
to
'add in'. I'd like the article to have a few pre-built functions that can
be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Angel Stewart

IsComplexDate()
=)

THis one will check if the date is in the form "mm/dd/yy" or "dd/mm/yy" or
"dd/mmm/"
depending on what the user enters :)
IsMediumDate(#startdate#, "dd-mmm-")

This will be true if startdate = "02-Jan-2000"
etc. etc.
And we have to be able to use it in OnValidate routines for CFINPUT tags

It's really simple.
I'd be willing to Beta Test it too.

-Gel

- Original Message -
From: Michael Dinowitz [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 2:10 PM
Subject: Re: Functions in Cold Fusion


 OK, I need some community input here. For my article on custom functions,
 I've written one for IsEmail and IsPhone. Can people send me a few others
to
 'add in'. I'd like the article to have a few pre-built functions that can
be
 used right off the bat. The only limits are that they must be built using
 functions in CF. No tags. For example, IsPhone uses this code:
 REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

 - Original Message -
 From: "Michael Dinowitz" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, August 01, 2000 12:42 PM
 Subject: Re: Functions in Cold Fusion


  I'm currently writing an article for the next Fusion Authority (out in
the
  next day) on how to write and use custom functions in CF. This is not
 using
  modules or any CF tags but is actually using function calls. It's a bit
of
 a
  hack and can look ugly in places, but it works. The result is that I can
  have something like IsValidEmail(email) and it'll return a value that
says
  yes or no.
 

 --
 
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
 

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Rick Osborne

(Because I know that if I didn't take the challenge then someone else
would...)

The perl regex for *HTTP URLs only* is:

(?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[
a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?
:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@=])*
)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@=])*))*)(?:\?(
?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@=])*))?)?)

CF doesn't support the "?:" operator (don't back-ref) or the "\d" escape
sequence (digit), so those needed to be taken out.  I wanted to make it a
bit more readable so I translated to POSIX classes where appropriate.  The
resulatant CF-style regex is:

(http://([[:alnum:]](([[:alnum:]]|-)*[[:alnum:]])?)\.)*([[:alpha:]](([[:
alnum:]]|-)*[[:alnum:]])?))|(([[:digit:]]+)(\.([[:digit:]]+)){3}))(:([[:digi
t:]]+))?)(/[a-zA-Z0-9$\-_.+!*'(),~]|(%[[:xdigit:]]{2}))|[;:@=])*)(/((([
a-zA-Z0-9$\-_.+!*'(),]|(%[[:xdigit:]]{2}))|[;:@=])*))*)(\?((([a-zA-Z0-9$\-_
.+!*'(),]|(%[[:xdigit:]]{2}))|[;:@=])*))?)?)

Since the entire thing is wrapped in parens, you can then use it in
REReplace and backref it with \1.  This leads to interesting uses:

IsURL(foo) = REFind(URLRegEx,foo)
URLify(foo) = REReplace(foo,URLRegEx,'A HREF="\1"\1/A',"ALL")

Notes:
- This doesn't take into account user/password info in the URL, like
(http://user:[EMAIL PROTECTED]/).  I'm pretty sure this is legal, but it may not
be.
- This is for HTTP URLs only.  If you want others and don't have the RegEx
skills, let me know and I can whip something up for you.
- I added in the tilde character for path information, as while it isn't
technically legal it is used quite a bit.

I did test this and it worked like a champ.  Go CF!  :)

-Rick

-Original Message-
From: Rick Osborne [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: Functions in Cold Fusion


(A bit tongue-in-cheek for a second, here.)

Have you seen a good regex for validating URLs lately?  It's *nasty*.  See:

http://www.foad.org/~abigail/Perl/url2.html

Or, if you're the type of person who skips to the end, the regex can be
found here:

http://www.foad.org/~abigail/Perl/url3.regex

It's a bit more than 7500 characters long.  :)  However, I think that it
would make an *excellent* test of CF's regex engine.  Of course you'd have
to translate from perl-style regexs to CF-style regexs, but it should be
possible.

-R

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 1:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion


How about IsURL?

At 01:10 PM 8/1/00 -0400, you wrote:
OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others
to
'add in'. I'd like the article to have a few pre-built functions that can
be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Jennifer

That's exactly why I suggested it. Talk about a handy, generally difficult 
to manage function that would be great to have a shortcut for. I figure 
that http, ftp, news, and file are the ones that most people would use; if 
those other schemes were missing I certainly wouldn't be offended.

At 02:06 PM 8/1/00 -0400, you wrote:
(A bit tongue-in-cheek for a second, here.)

Have you seen a good regex for validating URLs lately?  It's *nasty*.  See:

http://www.foad.org/~abigail/Perl/url2.html

Or, if you're the type of person who skips to the end, the regex can be
found here:

http://www.foad.org/~abigail/Perl/url3.regex

It's a bit more than 7500 characters long.  :)  However, I think that it
would make an *excellent* test of CF's regex engine.  Of course you'd have
to translate from perl-style regexs to CF-style regexs, but it should be
possible.

-R

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 1:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion


How about IsURL?

At 01:10 PM 8/1/00 -0400, you wrote:
 OK, I need some community input here. For my article on custom functions,
 I've written one for IsEmail and IsPhone. Can people send me a few others
to
 'add in'. I'd like the article to have a few pre-built functions that can
be
 used right off the bat. The only limits are that they must be built using
 functions in CF. No tags. For example, IsPhone uses this code:
 REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or 
send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread jeff tapper

Many others have addressed creating CF functions, so I'll just bite off the 
part of calling java classes.

In CF 4.5, allaire introduced the ability to call java classes directly 
with the CFOBJECT tag.  The biggest trick, is getting the correct jvm path 
into the CFAdministrator, which involves referencing the jvm.dll directly, 
rather than referencing the directory in which it resides.



At 10:39 AM 8/1/00 -0700, you wrote:
Can I make calls to a Java class or something like that?

==
Jeff Tapper
[EMAIL PROTECTED]
Team Manager / Lead Applications Architect
http://www.gtriad.com
G. Triad
==

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Brandon Behrens

That technique sounds like trying to make lemonade from lemons to me.  Why
not just use something else

Brandon Behrens
The Internet Design Firm
512.451.5225
[EMAIL PROTECTED]
http://www.theidf.com

-Original Message-
From: jeff tapper [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 12:17 PM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion

Many others have addressed creating CF functions, so I'll just bite off the
part of calling java classes.

In CF 4.5, allaire introduced the ability to call java classes directly
with the CFOBJECT tag.  The biggest trick, is getting the correct jvm path
into the CFAdministrator, which involves referencing the jvm.dll directly,
rather than referencing the directory in which it resides.



At 10:39 AM 8/1/00 -0700, you wrote:
Can I make calls to a Java class or something like that?

==
Jeff Tapper
[EMAIL PROTECTED]
Team Manager / Lead Applications Architect
http://www.gtriad.com
G. Triad
==


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Steve Bernard

It would also help to add position matching characters such as ^ and $. This
would prevent additional information from being passed along the URL. As
this regex stands additional information could be passed either before or
after a matched URL, without throwing any errors. I also added the ability
to accept an optional 's' for HTTPS URLs. I'm thinking about the
username/password part but, it will take more than a second to whip out.


--

(^https?://([[:alnum:]](([[:alnum:]]|-)*[[:alnum:]])?)\.)*([[:alpha:]]((
[[:
alnum:]]|-)*[[:alnum:]])?))|(([[:digit:]]+)(\.([[:digit:]]+)){3}))(:([[:digi
t:]]+))?)(/[a-zA-Z0-9$\-_.+!*'(),~]|(%[[:xdigit:]]{2}))|[;:@=])*)(/((([
a-zA-Z0-9$\-_.+!*'(),]|(%[[:xdigit:]]{2}))|[;:@=])*))*)(\?((([a-zA-Z0-9$\-_
.+!*'(),]|(%[[:xdigit:]]{2}))|[;:@=])*))?)?$)

--


Steve


-Original Message-
From: Rick Osborne [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 3:06 PM
To: [EMAIL PROTECTED]
Subject: RE: Functions in Cold Fusion


(Because I know that if I didn't take the challenge then someone else
would...)

The perl regex for *HTTP URLs only* is:

(?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.)*(?:[
a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)){3}))(?::(?
:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@=])*
)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@=])*))*)(?:\?(
?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{2}))|[;:@=])*))?)?)

CF doesn't support the "?:" operator (don't back-ref) or the "\d" escape
sequence (digit), so those needed to be taken out.  I wanted to make it a
bit more readable so I translated to POSIX classes where appropriate.  The
resulatant CF-style regex is:

(http://([[:alnum:]](([[:alnum:]]|-)*[[:alnum:]])?)\.)*([[:alpha:]](([[:
alnum:]]|-)*[[:alnum:]])?))|(([[:digit:]]+)(\.([[:digit:]]+)){3}))(:([[:digi
t:]]+))?)(/[a-zA-Z0-9$\-_.+!*'(),~]|(%[[:xdigit:]]{2}))|[;:@=])*)(/((([
a-zA-Z0-9$\-_.+!*'(),]|(%[[:xdigit:]]{2}))|[;:@=])*))*)(\?((([a-zA-Z0-9$\-_
.+!*'(),]|(%[[:xdigit:]]{2}))|[;:@=])*))?)?)

Since the entire thing is wrapped in parens, you can then use it in
REReplace and backref it with \1.  This leads to interesting uses:

IsURL(foo) = REFind(URLRegEx,foo)
URLify(foo) = REReplace(foo,URLRegEx,'A HREF="\1"\1/A',"ALL")

Notes:
- This doesn't take into account user/password info in the URL, like
(http://user:[EMAIL PROTECTED]/).  I'm pretty sure this is legal, but it may not
be.
- This is for HTTP URLs only.  If you want others and don't have the RegEx
skills, let me know and I can whip something up for you.
- I added in the tilde character for path information, as while it isn't
technically legal it is used quite a bit.

I did test this and it worked like a champ.  Go CF!  :)

-Rick

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Finding/Validating URLs (was: Functions in Cold Fusion)

2000-08-01 Thread Rick Osborne

(I'm hoping NSI is playing nice and has un-screwed-up my domain so that
y'all can see it ...)

I've put up a list of CF regexs for a number of different URL schemes at:

http://www.rixsoft.com/ColdFusion/regex.html

If you have problems with this URL, try the following, which is much less
permanent yet should work for everyone for the time being:

http://www.mojointeractive.com/rick/regex.html

Specifically, I put up the ones in the original perl document, which
includes: file, ftp, gopher, http, imap, ldap, mailto, news, nfs, nntp,
telnet, and wais.

Happy RegExing,
-Rick

-Original Message-
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 3:09 PM
To: [EMAIL PROTECTED]
Subject: RE: Functions in Cold Fusion


That's exactly why I suggested it. Talk about a handy, generally difficult
to manage function that would be great to have a shortcut for. I figure
that http, ftp, news, and file are the ones that most people would use; if
those other schemes were missing I certainly wouldn't be offended.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread jeff tapper

I'm not sure i get your point.  how would you make lemonade without lemons?

I was merely pointing out that it is possible to call java classes 
directly, and giving a tip into the most common error encountered when 
doing it.

At 02:36 PM 8/1/00 -0700, you wrote:
That technique sounds like trying to make lemonade from lemons to me.  Why
not just use something else

Brandon Behrens
The Internet Design Firm
512.451.5225
[EMAIL PROTECTED]
http://www.theidf.com

-Original Message-
From: jeff tapper [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 12:17 PM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion

Many others have addressed creating CF functions, so I'll just bite off the
part of calling java classes.

In CF 4.5, allaire introduced the ability to call java classes directly
with the CFOBJECT tag.  The biggest trick, is getting the correct jvm path
into the CFAdministrator, which involves referencing the jvm.dll directly,
rather than referencing the directory in which it resides.



At 10:39 AM 8/1/00 -0700, you wrote:
 Can I make calls to a Java class or something like that?

==
Jeff Tapper
[EMAIL PROTECTED]
Team Manager / Lead Applications Architect
http://www.gtriad.com
G. Triad
==


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or 
send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
the body.

==
Jeff Tapper
[EMAIL PROTECTED]
Team Manager / Lead Applications Architect
http://www.gtriad.com
G. Triad
==

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Benjamin S. Rogers

Hmm...a very interesting proposition. How about the following:

ArrayFind()
ArrayFindNoCase()
ArrayContains()
ArrayContainsNoCase()

In regards to your requirements, I imagine the ColdFusion function
ArrayToList() could be used in conjunction with the respective list
functions to "mimic" the functionality of the aforementioned functions.

Benjamin S. Rogers
Web Developer, c4.net
voice: (508) 240-0051
fax: (508) 240-0057

-Original Message-
From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 1:10 PM
To: [EMAIL PROTECTED]
Subject: Re: Functions in Cold Fusion


OK, I need some community input here. For my article on custom functions,
I've written one for IsEmail and IsPhone. Can people send me a few others to
'add in'. I'd like the article to have a few pre-built functions that can be
used right off the bat. The only limits are that they must be built using
functions in CF. No tags. For example, IsPhone uses this code:
REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)

- Original Message -
From: "Michael Dinowitz" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 01, 2000 12:42 PM
Subject: Re: Functions in Cold Fusion


 I'm currently writing an article for the next Fusion Authority (out in the
 next day) on how to write and use custom functions in CF. This is not
using
 modules or any CF tags but is actually using function calls. It's a bit of
a
 hack and can look ugly in places, but it works. The result is that I can
 have something like IsValidEmail(email) and it'll return a value that says
 yes or no.

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Rick Osborne

[Steve Bernard]
It would also help to add position matching characters such as
^ and $. This would prevent additional information from being
passed along the URL.

A good idea for an IsURL()-type function, but not for a URLify() or
FindURL() -type function, where the URL could be in the middle of the
string.

I also added the ability to accept an optional 's' for HTTPS URLs.

Excellent.  Hadn't thought of that.  Thanks.  :)

I'm thinking about the username/password part but, it will take
more than a second to whip out.

Not a problem, especially if you know perl and can mess with the
already-provided generator.  :)  I also fixed a couple other
perl-to-cf-conversion quirks.  (I didn't realize that CF doesn't escape
hyphens in the middle of character classes, you have to put them at the
front.)

I think that puts us at:

(https?://([-$_.+[:alnum:]!*'(),]|(%[[:xdigit:]]{2}))|[;?=])*)(:((([-a-
zA-Z0-9$_.+!*'(),]|(%[[:xdigit:]]{2}))|[;?=])*))?@)?([[:alnum:]](([[:al
num:]]|-)*[[:alnum:]])?)\.)*([[:alpha:]](([[:alnum:]]|-)*[[:alnum:]])?))|(([
[:digit:]]+)(\.([[:digit:]]+)){3}))(:([[:digit:]]+))?))(/[-a-zA-Z0-9$_.+
!*'(),~]|(%[[:xdigit:]]{2}))|[;:@=])*)(/((([-a-zA-Z0-9$_.+!*'(),~]|(%[[:xdi
git:]]{2}))|[;:@=])*))*)(\?((([-a-zA-Z0-9$_.+!*'(),~]|(%[[:xdigit:]]{2}))|[
;:@=])*))?)?)

Anyone or anything else?

-Rick

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: Functions in Cold Fusion

2000-08-01 Thread Rick Osborne

[Benjamin S. Rogers]
[How about the following:]

Aiight.  Devil's Advocate here, but if you're trying to hack search
functions for your arrays, you're probably not doing it right.  But, that's
just my opinion.  However, just as an exercise for the old noggin ...

Solutions when you do it infrequently:

ArrayFind(myArray,myString) =
ListFind(ArrayToList(myArray,Chr(1)),myString,Chr(1))
ArrayFindNoCase(myArray,myString) =
ListFindNoCase(ArrayToList(myArray,Chr(1)),myString,Chr(1))
ArrayContains(myArray,myString) =
ListContains(ArrayToList(myArray,Chr(1)),myString,Chr(1))
ArrayContainsNoCase(myArray,myString) =
ListContainsNoCase(ArrayToList(myArray,Chr(1)),myString,Chr(1))

NOw, if you are doing quite a number of lookups, in a loop for example, I
suggest you go with something a bit more efficient:

!--- Do this part once ---
CFSET myArrayLookup=StructNew()
CFLOOP FROM="1" TO="#ArrayLen(myArray)#" INDEX="i"
  CFSET ThisKey=myArray[i]
  CFIF StructKeyExists(myArrayLookup,ThisKey)
CFSET myArrayLookup[ThisKey]=ListAppend(myArrayLookup[ThisKey],i)
  CFELSE
CFSET myArrayLookup[ThisKey]=i
  /CFIF
/CFLOOP
!--- These next parts are what you will do over and over, it's lightning
fast ---
CFIF StructKeyExists(myArrayLookup,ThisKey)
  CFSET ArrayContains=True
  CFSET ArrayPositions=myArrayLookup[ThisKey]
CFELSE
  CFSET ArrayContains=False
  CFSET ArrayPositions=0
/CFIF

-Rick

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Michael Kear

Thanks for making this function Michael, but can I please pass this
BEGGING PLEA . 

cf_soapbox
If you want people outside the USA to fill in this form, DON"T use this
function   Most countries use a different numbering system to the USA.
They don't fit into this pattern.  Some places  don't even have area
codes.  And if they do have area codes, they aren't all 3 numbers.

The dutch for example, use a 99 99 99 99 pattern.  Here in Australia we
use (99)   or  999 999.  Then this isn't much use without the
country code.  So the international format for an Australian number is
99-9--.   

THerefore, if you use Michael's function, and someone from outside the USA
fills in your form, you're going to have information that looks like it's
valid, but isnt.

The worst case of this I have found was a famous international software
company I bought some software from a year or so ago.  Their form required
me to give them a zip code, a us-style phone number and -believe it or not
- a social security number.   I had to keep trying the form inventing
numbers until it was happy with the numbers I'd made up.  It didn't like
our 4 digit postcodes, so I had to use a 5 digit one I saw on an ad in an
American magazine.  It didn't like my 8 digit phone number, so I gave it a
number from another ad in the same magazine, and I had my brother's social
security number, so I changed it and tinkered around with it until the
form was happy with my fictional details.

Just my plea for keeping the Internet International.
/cf_soapbox

Cheers,
Mike Kear
AFP Web Development
Windsor, NSW, Australia 
http://www.afp.zip.com.au


On Tue, 1 Aug 2000, Michael Dinowitz wrote:

 OK, I need some community input here. For my article on custom functions,
 I've written one for IsEmail and IsPhone. Can people send me a few others to
 'add in'. I'd like the article to have a few pre-built functions that can be
 used right off the bat. The only limits are that they must be built using
 functions in CF. No tags. For example, IsPhone uses this code:
 REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)
 
 - Original Message -
 From: "Michael Dinowitz" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, August 01, 2000 12:42 PM
 Subject: Re: Functions in Cold Fusion
 
 
  I'm currently writing an article for the next Fusion Authority (out in the
  next day) on how to write and use custom functions in CF. This is not
 using
  modules or any CF tags but is actually using function calls. It's a bit of
 a
  hack and can look ugly in places, but it works. The result is that I can
  have something like IsValidEmail(email) and it'll return a value that says
  yes or no.
 
  --
 
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
 
 
 --
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
 

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread David Cummins

Thanks for mentioning that, I know exactly how you feel!

I'm from New Zealand, and there are some sites that have New Zealand as a
selectable country in their drop-downs, but still require a state and zip-code. 
What's worse is that some sites seem to check that the zip-code is appropriate
for the location you selected, and then you're really screwed - unless of course
you choose the only zip-code your know - Beverly Hills 90210 ;)

David Cummins
Systems Developer
Ubiquity Software Ltd.

Michael Kear wrote:
 
 Thanks for making this function Michael, but can I please pass this
 BEGGING PLEA .
 
 cf_soapbox
 If you want people outside the USA to fill in this form, DON"T use this
 function   Most countries use a different numbering system to the USA.
 They don't fit into this pattern.  Some places  don't even have area
 codes.  And if they do have area codes, they aren't all 3 numbers.
 
 The dutch for example, use a 99 99 99 99 pattern.  Here in Australia we
 use (99)   or  999 999.  Then this isn't much use without the
 country code.  So the international format for an Australian number is
 99-9--.
 
 THerefore, if you use Michael's function, and someone from outside the USA
 fills in your form, you're going to have information that looks like it's
 valid, but isnt.
 
 The worst case of this I have found was a famous international software
 company I bought some software from a year or so ago.  Their form required
 me to give them a zip code, a us-style phone number and -believe it or not
 - a social security number.   I had to keep trying the form inventing
 numbers until it was happy with the numbers I'd made up.  It didn't like
 our 4 digit postcodes, so I had to use a 5 digit one I saw on an ad in an
 American magazine.  It didn't like my 8 digit phone number, so I gave it a
 number from another ad in the same magazine, and I had my brother's social
 security number, so I changed it and tinkered around with it until the
 form was happy with my fictional details.
 
 Just my plea for keeping the Internet International.
 /cf_soapbox
 
 Cheers,
 Mike Kear
 AFP Web Development
 Windsor, NSW, Australia
 http://www.afp.zip.com.au
 
 On Tue, 1 Aug 2000, Michael Dinowitz wrote:
 
  OK, I need some community input here. For my article on custom functions,
  I've written one for IsEmail and IsPhone. Can people send me a few others to
  'add in'. I'd like the article to have a few pre-built functions that can be
  used right off the bat. The only limits are that they must be built using
  functions in CF. No tags. For example, IsPhone uses this code:
  REFindNoCase('([0-9]{3}[-_. /]?)?[0-9]{3}[-_. /]?[0-9]{4}', number)
 
  - Original Message -
  From: "Michael Dinowitz" [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, August 01, 2000 12:42 PM
  Subject: Re: Functions in Cold Fusion
 
 
   I'm currently writing an article for the next Fusion Authority (out in the
   next day) on how to write and use custom functions in CF. This is not
  using
   modules or any CF tags but is actually using function calls. It's a bit of
  a
   hack and can look ugly in places, but it works. The result is that I can
   have something like IsValidEmail(email) and it'll return a value that says
   yes or no.
  
   --
  
   Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
   To Unsubscribe visit
  http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
  send a message to [EMAIL PROTECTED] with 'unsubscribe' in
  the body.
  
 
  --
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
 
 
 --
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread paul smith

Wow!  Only 2 numbers for a whole Country/Continent ;-)
(Running  Ducking)

At 09:40 AM 8/2/00 +1000, you wrote:
Here in Australia we
use (99)   or  999 999.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread paul smith

ROFL.

Thanks!

best,  paul

At 01:53 PM 8/2/00 +1000, you wrote:
Yes, its a huge party line.  My allotted time on the phone is 4:02am -
4:07am Wednesdays, unless it's a police or fire emergency in which case I
have 5:15am-5:17am Saturdays as well.

And since the numbers are all 9s, it cuts the manufacturing costs of the
handsets a whole bunch.   And our phone directories are just a sheet of A4
paper instead of those big books.  You can fold them up and put them in
your pocket.  Or some people commit the entire directory of two numbers to
memory and dont need it at all.

Cheers,
Mike Kear
AFP Web Development
Windsor, NSW, Australia
http://www.afp.zip.com.au


On Tue, 1 Aug 2000, paul smith wrote:

  Wow!  Only 2 numbers for a whole Country/Continent ;-)
  (Running  Ducking)
 
  At 09:40 AM 8/2/00 +1000, you wrote:
  Here in Australia we
  use (99)   or  999 999.
 
  
 --
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit 
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk 
 or send a message to [EMAIL PROTECTED] with 'unsubscribe' 
 in the body.
 

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or 
send a message to [EMAIL PROTECTED] with 'unsubscribe' in 
the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Access Communication Concepts

 At 09:40 AM 8/2/00 +1000, you wrote:
 Here in Australia we
 use (99)   or  999 999.
Where in Oz are you?
Ron...

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Michael Kear

Windsor, NSW.  Near Sydney

The second type of number,  999 999 refers to the growing practice of
using a mobile as the main number.

Cheers,
Mike Kear
AFP Web Development
Windsor, NSW, Australia
http://www.afp.zip.com.au


On Wed, 2 Aug 2000, Access Communication Concepts wrote:

  At 09:40 AM 8/2/00 +1000, you wrote:
  Here in Australia we
  use (99)   or  999 999.
 Where in Oz are you?
 Ron...
 
 --
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
 

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: Functions in Cold Fusion

2000-08-01 Thread Access Communication Concepts

Cool Thanx, you are not too far away, I'm new to this list and situated in
Greystanes. I'll add my Penny Farthing's worth when it is appropriate.

Ron...

- Original Message -
From: Michael Kear [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 02, 2000 2:11 PM
Subject: Re: Functions in Cold Fusion


 Windsor, NSW.  Near Sydney

 The second type of number,  999 999 refers to the growing practice of
 using a mobile as the main number.

 Cheers,
 Mike Kear
 AFP Web Development
 Windsor, NSW, Australia
 http://www.afp.zip.com.au


 On Wed, 2 Aug 2000, Access Communication Concepts wrote:

   At 09:40 AM 8/2/00 +1000, you wrote:
   Here in Australia we
   use (99)   or  999 999.
  Where in Oz are you?
  Ron...
 

 --

  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
 

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.