¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Like, it's a function


PJ Fernandez
 

¿ªÔÆÌåÓý

Could we apply

CHRTRAN(?) Function

?

Replaces each character in a character expression that matches a character in a second character expression with the corresponding character in a third character expression.

CHRTRAN(cSearchedExpression, cSearchExpression, cReplacementExpression)

Return Values

Character

Parameters

cSearchedExpression
Specifies the expression in which CHRTRAN(?) replaces characters.
cSearchExpression
Specifies the expression containing the characters CHRTRAN(?) looks for in cSearchedExpression.
cReplacementExpression
Specifies the expression containing the replacement characters.

If a character in cSearchExpression is found in cSearchedExpression, the character in cSearchedExpression is replaced by a character from cReplacementExpression that's in the same position in cReplacementExpression as the respective character in cSearchExpression.

If cReplacementExpression has fewer characters than cSearchExpression, the additional characters in cSearchExpression are deleted from cSearchedExpression. If cReplacementExpression has more characters than cSearchExpression, the additional characters in cReplacementExpression are ignored.

Remarks

CHRTRAN(?) translates the character expression cSearchedExpression using the translation expressions cSearchExpression and cReplacementExpression and returns the resulting character string.

Example

? CHRTRAN('ABCDEF', 'ACE', 'XYZ')  && Displays XBYDZF
? CHRTRAN('ABCD', 'ABC', 'YZ')  && Displays YZD
? CHRTRAN('ABCDEF', 'ACE', 'XYZQRST')  && Displays XBYDZF

?

-----Original Message-----
From: Stein Goering [mailto:sgoering@...]
Sent: Friday, March 19, 2004 2:32 PM
To: madfox_vfp@...
Subject: RE: [madfox_vfp] Like, it's a function

Well, I had no clue of its existence.?

Certainly you could use regular exprs to do the same thing, but in some situations the LIKE function could save the hassle of instantiating a regex object.

?

LIKE(cExpression1, cExpression2)

Return Values

Logical

Parameters

cExpression1

Specifies the character expression that LIKE(?) compares with cExpression2. cExpression1 can contain the wildcards such as * and ?. The question mark (?) matches any single character in cExpression2 and the asterisk (*) matches any number of characters. You can mix any number of wildcards in any combination in cExpression1.

cExpression2

Specifies the character expression LIKE(?) compares with cExpression1. cExpression2 must match cExpression1 letter for letter in order for LIKE(?) to return true (.T.).

?

?

?

--stein

?

Stein Goering

Arbutus Computer Services

17494 Merry Hill Rd

Richland Center, WI? 53581

?

608.538.3820

?


From: Lorentzen David F. [mailto:DF.LORENTZEN@...]
Sent: Friday, March 19, 2004 2:24 PM
To: madfox_vfp@...
Subject: RE: [madfox_vfp] Like, it's a function

?

Eric -?It's had it, like, forever. It's in my FoxPro 2.6 language reference manual (remember manuals?), copyright 1993. Good morning, Rip Van Winkle!

?

If it makes you feel any better, it's not mentioned in my dBase III Plus manuals.

?

Seems like?this should be something to do?using Regular Expressions, eh?

-= Dave

David F. Lorentzen
Manager, HLA/Molecular Diagnostics Lab
University of Wisconsin Hospital and Clinics
600 Highland Ave
Madison, WI? 53792-2472

-----Original Message-----
From: Eric Selje [mailto:eselje@...]
Sent: Friday, March 19, 2004 1:55 PM
To: madfox_vfp@...
Subject: [madfox_vfp] Like, it's a function

Ok, I'm still looking for the previous function, and am probably gonna roll my own, but when did VFP get the Like() function?? That's cool!

Eric


Join [email protected] to automatically receive all group messages.