Page 2 of 2

Re: Sorting out letters from numbers in a field

Posted: Tue Apr 08, 2025 3:28 pm
by richmond62
Yes, unfortunately LiveCode does not have an isAlphabetic to strain out the %$#( type chars.

Re: Sorting out letters from numbers in a field

Posted: Tue Apr 08, 2025 3:49 pm
by dunbarx
Richmond,

True, though if one does this all day, make a function and load it into a plugin.

Code: Select all

function isAlpha var
if var is in "abcdefghijklmnopqrstuvwxyz" then return "true" else return "false"
end isAlpha
Craig

Re: Sorting out letters from numbers in a field

Posted: Tue Apr 08, 2025 4:01 pm
by FourthWorld
dunbarx wrote: Mon Apr 07, 2025 3:56 pm The problem with the OP's original post is that he is trying to ascribe that function to an element of field text as if it was a property of that element of text. That dog don't hunt.
If I could go back in time and change any one decision made by the original HyperCard team it would be their bizarre choice to allow property syntax ("of") when calling single-param functions.

Re: Sorting out letters from numbers in a field

Posted: Tue Apr 08, 2025 4:13 pm
by dunbarx
Richard.

I would be happy to go with you.

I assume it was during the time of making HyperTalk as friendly as possible, and the more "conversational" option of using the word "of" seemed appropriate. Bill Atkinson believed that everybody would be making personalized rolodexes with cute black and white figurines. Dan Winkler all the while was plugging away at hyperTalk. Bill was astounded when a couple hundred thousand people started demanding detailed information about writing scripts and everything they could get their hands on about HT. Bill underestimated the public's appetite for writing code, that is, the appetite to make bigger things than a rolodex.

Craig

Re: Sorting out letters from numbers in a field

Posted: Tue Apr 08, 2025 5:01 pm
by richmond62
make a function and load it into a plugin
You'd have a hell of a job writing a plugin that listed every alphabetic symbol listed by the Unicode consortium. 8)

Re: Sorting out letters from numbers in a field

Posted: Tue Apr 08, 2025 6:45 pm
by dunbarx
Richmond.

No, I don't do that sort of thing. But you might.

And so, looking at my plug-in, would it be so onerous to create a giant switch statement, with each language in a one-line case statement:

Code: Select all

function isAlpha var,language
switch language
  case "English"
    if var is in "abcdefghijklmnopqrstuvwxyz" then return "true" else return "false"
  break
  case "Bulgarian"
    if var is in ...
  break
  ...
end isAlpha
Craig

Re: Sorting out letters from numbers in a field

Posted: Wed Apr 09, 2025 2:51 am
by richmond62
I wonder how you would differentiate between languages that used the same alphabet?

Re: Sorting out letters from numbers in a field

Posted: Wed Apr 09, 2025 3:12 pm
by dunbarx
Richmond.
I wonder how you would differentiate between languages that used the same alphabet?
Why would you have to? All that function does is validate a certain character set. The French use the same set we do, so ""French" would just be another case statement:

Code: Select all

function isAlpha var,language
switch language
  case "English"
  case "French"
    if var is in "abcdefghijklmnopqrstuvwxyz" then return "true" else return "false"
  break
  case "Bulgarian"
    if var is in ...
  break
  ...
end isAlpha
The Greeks have only 24 letters in their alphabet, so they need their own character set.

Craig