This is the result of adding the 'copy':
Script: "
www.lotterychecker.com" (none)
** Script Error: copy expected value argument of type: series port bitset
** Where: evt-func
** Near: ch: copy event/key
if find
********************
I'll add the 'whole' script since it is not
too large...if you run this and then alternatively comment out the two lines checking for 'left' and 'right' keys..while
trying to filter for only numeric key entries...you will see ,
I believe, how the presence or absence of those two
tests adversly effects whether the test for digits only which follows actually works or not.
Here's the script:
Rebol[Title: "
www.lotterychecker.com"]
key-event: func [face event] [
if event/type = 'key [
ch: copy event/key
if find "left" ch [return event]
if find "right" ch [return event]
if not find "0123456789" ch [alert "Only digits can be entered" return none]
]
if event/type = 'close [
print "Removing event function"
remove-event-func :key-event
]
RETURN event
]
insert-event-func :key-event
lotto-layout: layout [backdrop green across tab tab
title red "
WWW.LOTTERYCHECKER.COM"
below
style numbox field 30x30 font [size:35]
h1 {A tool with which you store, manage and check groups of
lottery ticket numbers:} across
h1 blue "Select the game you wish to work with here --->"
game: choice 200x45 "PowerBall" "New York Lotto" "Thunderball" "MegaMillions"
return below
h2 {Indicate the function you wish to perform by clicking one
radio button below:}
across tab
radbutchk: radio h2 blue {Check the winning number below against all my tickets:}
return tab
radbutadd: radio h2 blue "Add number below to my file for this game"
return tab
radbutdel: radio h2 blue "Delete number below from my file for this game"
return tab
radbutver: radio h2 blue "Verify number below is on file for this game"
return tab
radbutlst: radio h2 blue {List all numbers for this game (no number need be entered
below):}
return
below
h2 {Enter (6) two digit numbers below to reflect the requirements of
the game you selected above. Use the last box for entering winning bonus
numbers for N.Y. Lotto, UK Nat'l. Lottery:}
across
num1: numbox "00" tab
num2: numbox "00" tab
num3: numbox "00" tab
num4: numbox "00" tab
num5: numbox "00" tab
num6: numbox "00" tab
num7: numbox "00"
return
box red 700x3 return
tab tab button 96x45 font [size: 25] "GO !!"
tab button 96x45 font [size: 25]"Reset" [clear-fields lotto-layout show lotto-layout]
]
focus num1
view lotto-layout