RE: testing on case
Well - what is the value of z... If your using z rather than "z", then, maybe there is some issue with the value of whatever you are putting into the variable z. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, December 10, 2004 11:12 AM To: How to use Revolution Subject: RE: testing on case Jonathan - That's weird, right? When I do this in the messagebox or in a button script: put matchText( z, "^[A-Z]") I definitely get "false" returned. But when I do this in the messagebox put matchText( z, "^[aA-zZ]") I get true. This is the way I would expect it to behave. I don't know why you would be getting different results. H. I'm running Rev 2.5 on MacOSX 10.3.6. - James "Lynch, Jonathan" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 12/09/04 04:02 PM Please respond to How to use Revolution To: "How to use Revolution" <[EMAIL PROTECTED]> cc: Subject:RE: testing on case Hi James... I tried: matchText( z, "^[A-Z]") and it worked fine for me... I tested it in the message box... matchText("b","^[A-Z]") returned false, and matchText("B","^[A-Z]") returned true -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, December 09, 2004 3:47 PM To: How to use Revolution Subject: Re: testing on case > The expression matchText( z, "^[A-Z]") > will return true if (and only when) the > first character is an ASCII capital letter. That returns "false" for me. You'll need to do it like this to cover upper and lower case. matchText(z,"^[aA-zZ]") Cheers...James |-+---> | | Dar Scott <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | .runrev.com | | | | | | | | | 12/09/04 02:53 PM | | | Please respond to How to use| | | Revolution | |-+---> >------- -| | | | To: How to use Revolution <[EMAIL PROTECTED]>| | cc: | | Subject: Re: testing on case | >--- -| On Dec 9, 2004, at 11:46 AM, Hershel Fisch wrote: >> if matchText( param(x), "^[A-Z]") then put xxx else put x > I don't get it The expression matchText( z, "^[A-Z]") will return true if (and only when) the first character is an ASCII capital letter. The "^" matches the beginning of the string (or line). A more exact pattern is "\A"; I used "^" because it might be more familiar. The immediately following pattern [A-Z] matches any letter in the range A-Z in ASCII. It must match right after the previous pattern match, that is, the beginning. There is no pattern matching for the end of the string so the rest of the string z does not matter. That is, matchText() returns true if the pattern occurs anywhere in the string, not just if it matches the whole string. (Use \A and \z to match the ends to make a pattern match the whole string.) You can find more info on regular expressions here: http://www.perldoc.com/perl5.8.0/pod/perlre.html But you have to skip over all the perl specific parts. You can find more specific information on exact usage of the actual library used in Revolution and (I assume) Dreamcard here: http://www.pcre.org/pcre.txt But you have to skip over all the building and calling parts. Skip down to PCRE REGULAR EXPRESSION DETAILS. I think you need to skip over the unicode and UTF-8 paragraphs, too, for now. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 10, 2004, at 9:12 AM, [EMAIL PROTECTED] wrote: put matchText( z, "^[A-Z]") I definitely get "false" returned. matchText( "mom", "^[A-Z]") ==> false matchText( "Mom", "^[A-Z]") ==> true matchText( "=Mom", "^[A-Z]") ==> false matchText( "\Mom", "^[A-Z]") ==> false This is consistent with testing whether the first character is a capital (ASCII) letter. The regex looks good. But when I do this in the messagebox put matchText( z, "^[aA-zZ]") I get true. This is the way I would expect it to behave. put matchText( "mom", "^[aA-zZ]") ==> true put matchText( "Mom", "^[aA-zZ]") ==> true put matchText( "=Mom", "^[aA-zZ]") ==> false put matchText( "\Mom", "^[aA-zZ]") ==> true Here is what is going on. The pattern [aA-zZ] will match any of these letters: a ABCDEFGHIJKLMNOPQRSTUVWZYZ[\]^_`abcdefghijklmnopqrstuvwxyz Z The range portion is usually environment dependent and depends on the collating order or the coding order used in an implementation. For ASCII and code sets that are supersets of ASCII, the pattern A-z would result in matching the middle line above. charToNum("A")==> 65 charToNum("\")==> 92 charToNum("z")==> 122 An alternative that might be better for the future is this: matchText( "mom", "^[[:upper:]]") or better matchText( "mom", "\A[[:upper:]]") The matching is currently ASCII, but the library can handle UTF-8, somewhat, and if Revolution is ever extended to handle that, that pattern should be ready. It might be that the library will also be extended to handle other popular high codes. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: testing on case
Jonathan - That's weird, right? When I do this in the messagebox or in a button script: put matchText( z, "^[A-Z]") I definitely get "false" returned. But when I do this in the messagebox put matchText( z, "^[aA-zZ]") I get true. This is the way I would expect it to behave. I don't know why you would be getting different results. H. I'm running Rev 2.5 on MacOSX 10.3.6. - James "Lynch, Jonathan" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 12/09/04 04:02 PM Please respond to How to use Revolution To: "How to use Revolution" <[EMAIL PROTECTED]> cc: Subject:RE: testing on case Hi James... I tried: matchText( z, "^[A-Z]") and it worked fine for me... I tested it in the message box... matchText("b","^[A-Z]") returned false, and matchText("B","^[A-Z]") returned true -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, December 09, 2004 3:47 PM To: How to use Revolution Subject: Re: testing on case > The expression matchText( z, "^[A-Z]") > will return true if (and only when) the > first character is an ASCII capital letter. That returns "false" for me. You'll need to do it like this to cover upper and lower case. matchText(z,"^[aA-zZ]") Cheers...James |-+---> | | Dar Scott <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | .runrev.com | | | | | | | | | 12/09/04 02:53 PM | | | Please respond to How to use| | | Revolution | |-+---> >----------- -| | | | To: How to use Revolution <[EMAIL PROTECTED]>| | cc: | | Subject: Re: testing on case | >--- -| On Dec 9, 2004, at 11:46 AM, Hershel Fisch wrote: >> if matchText( param(x), "^[A-Z]") then put xxx else put x > I don't get it The expression matchText( z, "^[A-Z]") will return true if (and only when) the first character is an ASCII capital letter. The "^" matches the beginning of the string (or line). A more exact pattern is "\A"; I used "^" because it might be more familiar. The immediately following pattern [A-Z] matches any letter in the range A-Z in ASCII. It must match right after the previous pattern match, that is, the beginning. There is no pattern matching for the end of the string so the rest of the string z does not matter. That is, matchText() returns true if the pattern occurs anywhere in the string, not just if it matches the whole string. (Use \A and \z to match the ends to make a pattern match the whole string.) You can find more info on regular expressions here: http://www.perldoc.com/perl5.8.0/pod/perlre.html But you have to skip over all the perl specific parts. You can find more specific information on exact usage of the actual library used in Revolution and (I assume) Dreamcard here: http://www.pcre.org/pcre.txt But you have to skip over all the building and calling parts. Skip down to PCRE REGULAR EXPRESSION DETAILS. I think you need to skip over the unicode and UTF-8 paragraphs, too, for now. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Dar- Wednesday, December 8, 2004, 5:34:27 PM, you wrote: >> on IsUpperCase w >> return toUpper(w) is w >> end IsUpperCase DS> Cool. But won't this need caseSensitive set to true? Right you are. My fingers think faster than my head. -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: testing on case
Hi James... I tried: matchText( z, "^[A-Z]") and it worked fine for me... I tested it in the message box... matchText("b","^[A-Z]") returned false, and matchText("B","^[A-Z]") returned true -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Thursday, December 09, 2004 3:47 PM To: How to use Revolution Subject: Re: testing on case > The expression matchText( z, "^[A-Z]") > will return true if (and only when) the > first character is an ASCII capital letter. That returns "false" for me. You'll need to do it like this to cover upper and lower case. matchText(z,"^[aA-zZ]") Cheers...James |-+---> | | Dar Scott <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | .runrev.com | | | | | | | | | 12/09/04 02:53 PM | | | Please respond to How to use| | | Revolution | |-+---> >--- -| | | | To: How to use Revolution <[EMAIL PROTECTED]>| | cc: | | Subject: Re: testing on case | >--- -| On Dec 9, 2004, at 11:46 AM, Hershel Fisch wrote: >> if matchText( param(x), "^[A-Z]") then put xxx else put x > I don't get it The expression matchText( z, "^[A-Z]") will return true if (and only when) the first character is an ASCII capital letter. The "^" matches the beginning of the string (or line). A more exact pattern is "\A"; I used "^" because it might be more familiar. The immediately following pattern [A-Z] matches any letter in the range A-Z in ASCII. It must match right after the previous pattern match, that is, the beginning. There is no pattern matching for the end of the string so the rest of the string z does not matter. That is, matchText() returns true if the pattern occurs anywhere in the string, not just if it matches the whole string. (Use \A and \z to match the ends to make a pattern match the whole string.) You can find more info on regular expressions here: http://www.perldoc.com/perl5.8.0/pod/perlre.html But you have to skip over all the perl specific parts. You can find more specific information on exact usage of the actual library used in Revolution and (I assume) Dreamcard here: http://www.pcre.org/pcre.txt But you have to skip over all the building and calling parts. Skip down to PCRE REGULAR EXPRESSION DETAILS. I think you need to skip over the unicode and UTF-8 paragraphs, too, for now. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
> The expression matchText( z, "^[A-Z]") > will return true if (and only when) the > first character is an ASCII capital letter. That returns "false" for me. You'll need to do it like this to cover upper and lower case. matchText(z,"^[aA-zZ]") Cheers...James |-+---> | | Dar Scott <[EMAIL PROTECTED]>| | | Sent by:| | | [EMAIL PROTECTED]| | | .runrev.com | | | | | | | | | 12/09/04 02:53 PM | | | Please respond to How to use| | | Revolution | |-+---> >| | | | To: How to use Revolution <[EMAIL PROTECTED]> | | cc: | | Subject: Re: testing on case | >| On Dec 9, 2004, at 11:46 AM, Hershel Fisch wrote: >> if matchText( param(x), "^[A-Z]") then put xxx else put x > I don't get it The expression matchText( z, "^[A-Z]") will return true if (and only when) the first character is an ASCII capital letter. The "^" matches the beginning of the string (or line). A more exact pattern is "\A"; I used "^" because it might be more familiar. The immediately following pattern [A-Z] matches any letter in the range A-Z in ASCII. It must match right after the previous pattern match, that is, the beginning. There is no pattern matching for the end of the string so the rest of the string z does not matter. That is, matchText() returns true if the pattern occurs anywhere in the string, not just if it matches the whole string. (Use \A and \z to match the ends to make a pattern match the whole string.) You can find more info on regular expressions here: http://www.perldoc.com/perl5.8.0/pod/perlre.html But you have to skip over all the perl specific parts. You can find more specific information on exact usage of the actual library used in Revolution and (I assume) Dreamcard here: http://www.pcre.org/pcre.txt But you have to skip over all the building and calling parts. Skip down to PCRE REGULAR EXPRESSION DETAILS. I think you need to skip over the unicode and UTF-8 paragraphs, too, for now. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: testing on case
This should work on the whole string: Set the casesensitive to true If x = toupper(x) then... That would work even if some characters are numbers, and thus not in the a-z set, but still not considered uppercase For a single character you can do if chartonum(x) = chartonum(toupper(x)) then... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hershel Fisch Sent: Thursday, December 09, 2004 1:49 PM To: How to use Revolution Subject: Re: testing on case on the first letter , but good to know-'em both ways. Thanks,Hershel On Wednesday, December 8, 2004, at 05:24 PM, Frank D. Engel, Jr. wrote: > Are you trying to test the first letter only, or the entire string? > The proposals so far only test the first character of the string. If > you need the whole thing to be uppercase: > > function uppercase ofText > set the caseSensitive to true > repeat for each char ch in "abcdefghijklmnopqrstuvwxyz" > if ch is among the chars of ofText then return false > end repeat > return true > end uppercase > > > Now you can do things like: > > if uppercase(ofText) then > -- whatever > end if > > > or to test the first char of each word: > > function wordcase ofText > set the caseSensitive to true > repeat for each word w in ofText > if char 1 of w is among the chars of "abcdefghijklmnopqrstuvwxyz" > then return false > end repeat > return true > end wordcase > > > and similarly, > > if wordcase(ofText) then > -- do something > end if > > On Dec 8, 2004, at 4:55 PM, Dar Scott wrote: > >> >> On Dec 8, 2004, at 2:46 PM, Dar Scott wrote: >> >>> If you must avoid a function (sniff, I like functions), then >>> consider this: >>> >>> if matchText( param(x), "^[A-Z]") then put xxx else put x >> >> or this (if useUnicode is not true and you know it starts with a >> letter) >> >> if charToNum( param(x) ) < 97 then put xxx else put x >> >> To me a function is more readable. Are you concerned about speed? >> >> Dar >> >> >> Dar Scott Consulting >> http://www.swcp.com/dsc/ >> Programming Services >> >> >> ___ >> use-revolution mailing list >> [EMAIL PROTECTED] >> http://lists.runrev.com/mailman/listinfo/use-revolution >> >> > --- > Frank D. Engel, Jr. <[EMAIL PROTECTED]> > > $ ln -s /usr/share/kjvbible /usr/manual > $ true | cat /usr/manual | grep "John 3:16" > John 3:16 For God so loved the world, that he gave his only begotten > Son, that whosoever believeth in him should not perish, but have > everlasting life. > $ > > > > ___ > $0 Web Hosting with up to 120MB web space, 1000 MB Transfer > 10 Personalized POP and Web E-mail Accounts, and much more. > Signup at www.doteasy.com > > ___ > use-revolution mailing list > [EMAIL PROTECTED] > http://lists.runrev.com/mailman/listinfo/use-revolution > ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 9, 2004, at 11:46 AM, Hershel Fisch wrote: if matchText( param(x), "^[A-Z]") then put xxx else put x I don't get it The expression matchText( z, "^[A-Z]") will return true if (and only when) the first character is an ASCII capital letter. The "^" matches the beginning of the string (or line). A more exact pattern is "\A"; I used "^" because it might be more familiar. The immediately following pattern [A-Z] matches any letter in the range A-Z in ASCII. It must match right after the previous pattern match, that is, the beginning. There is no pattern matching for the end of the string so the rest of the string z does not matter. That is, matchText() returns true if the pattern occurs anywhere in the string, not just if it matches the whole string. (Use \A and \z to match the ends to make a pattern match the whole string.) You can find more info on regular expressions here: http://www.perldoc.com/perl5.8.0/pod/perlre.html But you have to skip over all the perl specific parts. You can find more specific information on exact usage of the actual library used in Revolution and (I assume) Dreamcard here: http://www.pcre.org/pcre.txt But you have to skip over all the building and calling parts. Skip down to PCRE REGULAR EXPRESSION DETAILS. I think you need to skip over the unicode and UTF-8 paragraphs, too, for now. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
>> Are you trying to test the first letter only, or the entire string? >> The proposals so far only test the first character of the string. If >> you need the whole thing to be uppercase: Not sure if someone already tossed this solution out: function caseTest tString set the caseSensitive to true if tString = toUpper(tString) then return true else return false end caseTest Regards, Scott Rossi Creative Director Tactile Media, Development & Design - E: [EMAIL PROTECTED] W: http://www.tactilemedia.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
on the first letter , but good to know-'em both ways. Thanks,Hershel On Wednesday, December 8, 2004, at 05:24 PM, Frank D. Engel, Jr. wrote: Are you trying to test the first letter only, or the entire string? The proposals so far only test the first character of the string. If you need the whole thing to be uppercase: function uppercase ofText set the caseSensitive to true repeat for each char ch in "abcdefghijklmnopqrstuvwxyz" if ch is among the chars of ofText then return false end repeat return true end uppercase Now you can do things like: if uppercase(ofText) then -- whatever end if or to test the first char of each word: function wordcase ofText set the caseSensitive to true repeat for each word w in ofText if char 1 of w is among the chars of "abcdefghijklmnopqrstuvwxyz" then return false end repeat return true end wordcase and similarly, if wordcase(ofText) then -- do something end if On Dec 8, 2004, at 4:55 PM, Dar Scott wrote: On Dec 8, 2004, at 2:46 PM, Dar Scott wrote: If you must avoid a function (sniff, I like functions), then consider this: if matchText( param(x), "^[A-Z]") then put xxx else put x or this (if useUnicode is not true and you know it starts with a letter) if charToNum( param(x) ) < 97 then put xxx else put x To me a function is more readable. Are you concerned about speed? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Wednesday, December 8, 2004, at 04:46 PM, Dar Scott wrote: On Dec 8, 2004, at 2:09 PM, Hershel Fisch wrote: Thanks, I think its a bit to much when I wanted it to set up query's , too many functions involved. I hoped that there is a if param(x) "is upperCase" then put xxx else put x I don't understand why a function won't work. Here is a simpler function that you can apply to just a word: function isUpperCase w constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" set the caseSensitive to true return char 1 of w is in capitalLetters end isCapitalized if isUpperCase( param(x) ) then put xxx else put x This looks to be much faster and smoother. If you must avoid a function (sniff, I like functions), then consider this: if matchText( param(x), "^[A-Z]") then put xxx else put x I don't get it Thanks a mill. Hershel Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Hi Jonathan, What would be wrong with... Set the casesensitive to true If x = toupper(x) then put xxx else put x nothing, actually :-) Best Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: testing on case
What would be wrong with... Set the casesensitive to true If x = toupper(x) then put xxx else put x -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Klaus Major Sent: Thursday, December 09, 2004 10:50 AM To: How to use Revolution Subject: Re: testing on case Hi Herschel, > Thanks, I think its a bit to much when I wanted it to set up query's , > too many functions involved. I hoped that there is a > if param(x) "is upperCase" then put xxx else put x maybe checking "chartonum(char 1 of xyz)" will do? If < 97, it will be a capital... Regards Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Hi Herschel, Thanks, I think its a bit to much when I wanted it to set up query's , too many functions involved. I hoped that there is a if param(x) "is upperCase" then put xxx else put x maybe checking "chartonum(char 1 of xyz)" will do? If < 97, it will be a capital... Regards Klaus Major [EMAIL PROTECTED] http://www.major-k.de ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 8, 2004, at 5:06 PM, Mark Wieder wrote: on IsUpperCase w return toUpper(w) is w end IsUpperCase Cool. But won't this need caseSensitive set to true? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Dar- Wednesday, December 8, 2004, 1:46:05 PM, you wrote: or... on IsUpperCase w return toUpper(w) is w end IsUpperCase on IsLowerCase w return toLower(w) is w end IsLowerCase if IsUpperCase(x) then put xxx else put x -- -Mark Wieder [EMAIL PROTECTED] ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
At 17:24 08/12/2004 -0500, Frank D. Engel, Jr. wrote: Are you trying to test the first letter only, or the entire string? The proposals so far only test the first character of the string. If you need the whole thing to be uppercase: function uppercase ofText set the caseSensitive to true repeat for each char ch in "abcdefghijklmnopqrstuvwxyz" if ch is among the chars of ofText then return false end repeat return true end uppercase H - that says that "ABC DEF" is not uppercase (because of the space in the middle). function isUpperCase pText set caseSensitive to true return (pText = upper(pText)) end isUpperCase Not that that's perfect either - the problem is there are 4 (or 5) possible results upper case lower case word case mixed case no case (i.e. no letters) so deciding just which ones to include as "isUpperCase" is a context-dependent choice. -- Alex. ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Are you trying to test the first letter only, or the entire string? The proposals so far only test the first character of the string. If you need the whole thing to be uppercase: function uppercase ofText set the caseSensitive to true repeat for each char ch in "abcdefghijklmnopqrstuvwxyz" if ch is among the chars of ofText then return false end repeat return true end uppercase Now you can do things like: if uppercase(ofText) then -- whatever end if or to test the first char of each word: function wordcase ofText set the caseSensitive to true repeat for each word w in ofText if char 1 of w is among the chars of "abcdefghijklmnopqrstuvwxyz" then return false end repeat return true end wordcase and similarly, if wordcase(ofText) then -- do something end if On Dec 8, 2004, at 4:55 PM, Dar Scott wrote: On Dec 8, 2004, at 2:46 PM, Dar Scott wrote: If you must avoid a function (sniff, I like functions), then consider this: if matchText( param(x), "^[A-Z]") then put xxx else put x or this (if useUnicode is not true and you know it starts with a letter) if charToNum( param(x) ) < 97 then put xxx else put x To me a function is more readable. Are you concerned about speed? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 8, 2004, at 2:46 PM, Dar Scott wrote: If you must avoid a function (sniff, I like functions), then consider this: if matchText( param(x), "^[A-Z]") then put xxx else put x or this (if useUnicode is not true and you know it starts with a letter) if charToNum( param(x) ) < 97 then put xxx else put x To me a function is more readable. Are you concerned about speed? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 8, 2004, at 2:09 PM, Hershel Fisch wrote: Thanks, I think its a bit to much when I wanted it to set up query's , too many functions involved. I hoped that there is a if param(x) "is upperCase" then put xxx else put x I don't understand why a function won't work. Here is a simpler function that you can apply to just a word: function isUpperCase w constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" set the caseSensitive to true return char 1 of w is in capitalLetters end isCapitalized if isUpperCase( param(x) ) then put xxx else put x If you must avoid a function (sniff, I like functions), then consider this: if matchText( param(x), "^[A-Z]") then put xxx else put x Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Thanks, I think its a bit to much when I wanted it to set up query's , too many functions involved. I hoped that there is a if param(x) "is upperCase" then put xxx else put x On Wednesday, December 8, 2004, at 03:46 PM, Dar Scott wrote: On Dec 8, 2004, at 1:28 PM, Dar Scott wrote: Untested: function isCapitalized @x, n, m constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" return char 1 word n of line m of x is in capitalLetters end isCapitalized Whoops! on mouseUp put "one two three" & lf & "Alpha beta" into x put isCapitalized(x,2,1) && isCapitalized(x,1,2) end mouseUp function isCapitalized @x, n, m constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" set the caseSensitive to true return char 1 word n of line m of x is in capitalLetters end isCapitalized Now tested. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 8, 2004, at 1:28 PM, Dar Scott wrote: Untested: function isCapitalized @x, n, m constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" return char 1 word n of line m of x is in capitalLetters end isCapitalized Whoops! on mouseUp put "one two three" & lf & "Alpha beta" into x put isCapitalized(x,2,1) && isCapitalized(x,1,2) end mouseUp function isCapitalized @x, n, m constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" set the caseSensitive to true return char 1 word n of line m of x is in capitalLetters end isCapitalized Now tested. Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
On Dec 8, 2004, at 1:08 PM, Hershel Fisch wrote: how do I test on the case of a word of a line ? Untested: function isCapitalized @x, n, m constant capitalLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" return char 1 word n of line m of x is in capitalLetters end isCapitalized If that misses the mark, consider matchText(). Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
Sorry , meant "upper or lower case" (was to engaged in the work) On Wednesday, December 8, 2004, at 03:19 PM, Frank D. Engel, Jr. wrote: What kind of test do you have in mind? word 4 of line 5 the first word of line 6 the last word of the first line "hello" is among the words of the last line word 3 of line 6 is not word 2 of line 9 On Dec 8, 2004, at 3:08 PM, Hershel Fisch wrote: HI , all how do I test on the case of a word of a line ? Thanks, Hershel ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: testing on case
What kind of test do you have in mind? word 4 of line 5 the first word of line 6 the last word of the first line "hello" is among the words of the last line word 3 of line 6 is not word 2 of line 9 On Dec 8, 2004, at 3:08 PM, Hershel Fisch wrote: HI , all how do I test on the case of a word of a line ? Thanks, Hershel ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution --- Frank D. Engel, Jr. <[EMAIL PROTECTED]> $ ln -s /usr/share/kjvbible /usr/manual $ true | cat /usr/manual | grep "John 3:16" John 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life. $ ___ $0 Web Hosting with up to 120MB web space, 1000 MB Transfer 10 Personalized POP and Web E-mail Accounts, and much more. Signup at www.doteasy.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
testing on case
HI , all how do I test on the case of a word of a line ? Thanks, Hershel ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution