Try something like this:
// Let them type in Y/N/navigate/delete/tab
if asc(Key) = 8 or asc(Key) = 28 or asc(Key) = 29 or asc(Key) = 9 or
Uppercase(Key) = "Y" or Uppercase(Key) = "N" then return FALSE
// Otherwise check for action
if asc(Key) = 13 and me.Text <> "" then
if Uppercase(me.Text) = "Y" then 'Note: String comparisons of
this type should NOT be case sensitive
// Do 'Yes' stuff
Speak "Yes!"
else
// Do 'No' Stuff (If it ain't 'Y', then it must be 'N'!)
Speak "No"
end if
end if
// If we get here, then they have not entered an allowable Key, or
they are finished, no problem
// so we return TRUE to ignore any other keys, or to simply stop
further processing of the event
Return TRUE
That logic is, well, perhaps a bit simpler, to me at least. :-)
I built it on the Mac (2006r2) and ran it in Virtual PC and it seemed
to work fine.
Hope that helps,
-Scott
On Apr 18, 2006, at 11:34 AM, Joshua Demori wrote:
Scott,
Actually that would work with the lowercase. I tried this though
If me.text = "Y" or me.text = "y" then .....
cant do the key because I want the option for them to be able to
change thier mind unless
hitting enter which finalizes everything.
some bad programming in rs for case statements
I removed the case and it works now putting something like this
Only when the enter key is hit do I return true so as not to pass that
down any further,
if it is a normal key that is either y or n or that is delete or
arrows I allow that to pass through.
I dont return false at the end becasue I believe that is a default
action. You are going to make me
cry I'm broke broke broke : ( Its a same to have to buy another
version when they all should produce
good executables. You would think.
Thanks Scott for you input!
Josh
On Apr 18, 2006, at 12:24 PM, Scott Thompson wrote:
Another thing to try is something like this:
Key = Lowercase(Key)
Then only check for "y" and "n" ... maybe that will help.
Also, did you intend to Return False sometime? It looks like all
situations
Return True.
Compiling cross-platform can be tricky. I finally broke down and just
got
the Professional Version on both platforms... made my life a bit
easier
when debugging Windoze. :-(
-Scott
On Apr 18, 2006, at 11:02 AM, Joshua Demori wrote:
Yes I limit text to 1 character and there is no mask as the case
should , should yet now it doesn't check the uppercase N
yet senses a lowercase n very strange, yet i got it to work again
weird as it may sound (not for rs) is that by placing another
editfield that was not visible or is visible and put some dumb data
text into it as it is checking certain things it works or even if I
put msgboxs. Building with mac2006r2 for windows. This is really bad
programming to have these weird dependencies.
Ive spent two days sorry if Im a little upset when something worked
before.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>