REVO27005Speed2@dg6 revstackfalseOon preOpenCard set the vScroll of fld "Notes" to 0 end preOpenCard 4 Speed tests U Arial BlackU Arial BlackW Arial BlackW Arial Black ULucida GrandeULucida Grande ULucida GrandecRevStandaloneSettingsCscriptLibrariesInternet Geometry PrintingMacOSXfalseMacOS,documentTypeUNIX,fileSelectortrueWeb,WindowsSupportedtrueWindowsfalseWindows,LegalCopyright#2009 All rights reserved worldwideUNIX,pageSetuptrueWebtrueWeb,LinuxSupportedtrue answerDialogtrueWindows,FileDescriptionSpeed 1.0.0.0 for WindowsOSX,longVersion Speed 1.0.0.0Web,RequestedNameOSX,copyright#2009 All rights reserved worldwideWindows,buildU3falseWeb,CustomBackgroundColor 237,237,237Web,CustomLoadIconMacOS,versionnumber11MacOS,ReleaseFinalMacOS,versionnumber20MacOS,versionnumber30nameSpeedOSX,identifier com..speedWeb,InstanceIdOSX,shortVersion1.0.0.0Windows,fileversion11Windows,fileversion20Windows,fileversion30Windows,fileversion40cursorsfalseWeb,MacOSXSupportedtrueMacOS,dynamicMemorytrueMacOSX PowerPC-32false Windows,UUID$9DACB581-3C1E-469D-9BE0-56B7B3FD1F38MacOS,PreferredSize15000MacOS,creator???? OSX,nameSpeedMacOS,longVersion Speed 1.0.0.0OSX,documentTypeWeb,MinEnvironmentVersionWindows,documenticonFilei/Applications/Revolution Enterprise/4.0.0-dp-3/Runtime/Windows/x86-32/Support/Sample Icons/genericdoc.ico inclusionssearch Web,Domain0xFFOSX,documentExtensionWeb,AllowOtherPlatformstrueWeb,DetectSecurityPermissionstrueUNIX,printerChoosertrueWeb,SecurityPermissions,,,,,,,,MacOS,MinimumSize15000 MacOS,Region1Windows,productversion11Windows,productversion20Windows,productversion30 OSX,infoSpeed Version 1.0.0.0Windows,productversion40Web,ExecutionModeBrowserWeb,CustomBackgroundColor2 237,237,237 askDialogtrueWindows,iconFilei/Applications/Revolution Enterprise/4.0.0-dp-3/Runtime/Windows/x86-32/Support/Sample Icons/genericapp.icoOSX,signature???? Web,UUID$F80F5FB5-CBD8-42E0-8C36-3C3167A75587Windows,ProductNameSpeeddefaultBuildFolder/Users/sarahtim/DesktopUNIX,colorChoosertrueMacOSX x86-32falseWindows,companynamecREVGeometryCachestackID1077 cREVGeneralscriptChecksum*NlQΤ bookmarks handlerList preOpenCard tempScript prevHandler resizeStackscriptSelection char 53 to 52script

on preOpenCard

set the vScroll of fld "Notes" to 0

end preOpenCard

 @6!# card id 1002 @6345 @6 cREVGeneralscriptChecksumُ B~ bookmarks handlerList tempScript prevHandlerscriptSelection char 1 to 0script

 @6cREVGeometryCacheIDs1024459816879103110243825621111014125015309189110111024382832633101912501530918921012102438388810810251250153091893101312501530918941020125015309189510231250153091896102412501530918971034125015309189810381250153091899103910243825137631010102447061746610361024370300013100610244705917721035102438260376010161024459810306103010243522815911005102447126717210411024470230221103210243825818991015102435208363810041024471227941104010243518767971003102438273550610171024470559271103310243836162301022cREVGeometrycacheorder total29   @6 @6 Lock screen`ERY cREVGeneral revUniqueID 1024383338927 >  cREVGeneral revUniqueID 1024383888108 List boxK`3J cREVGeneral revUniqueID 1024352281591Top boxK`333ff6N cREVGeneral revUniqueID 1024351876797 Title  ff@6N cREVGeneral revUniqueID 1024352083638  5. refer to cards, don't go  "4. convert long lists into arrays  !3. don't show progress too often  2. use 'repeat for each'  1. use variables not fields Data `@Xj cREVGeneral revUniqueID 1024370300013 176 585 284 760 853 167 611 79 373 546 394 685 603 558 607 479 883 920 286 937 711 805 251 976 406 530 270 559 915 198 868 972 83 42 468 408 770 61 345 667 682 250 65 536 27 421 18 904 796 561 531 902 296 870 141 468 400 868 367 413 977 10 763 723 994 373 871 604 661 885 836 465 409 830 773 219 998 710 190 76 307 838 142 595 308 16 635 337 314 525 831 14 78 74 787 803 732 970 875 132 840 69 411 217 760 200 668 175 823 43 972 281 225 435 462 856 199 80 844 22 860 556 705 852 734 510 101 129 298 412 14 246 100 232 106 856 59 700 112 567 175 353 178 552 6 615 899 909 182 445 461 417 902 378 931 156 622 685 740 836 956 36 982 535 562 18 368 527 496 665 14 512 4 284 639 767 201 185 866 611 724 922 934 194 631 539 185 835 195 476 693 995 171 915 646 199 946 632 822 847 855 13 300 354 982 927 435 609 1000 98 990 393 703 575 953 627 967 750 97 715 79 103 420 445 891 722 560 260 736 593 604 907 713 344 9 502 981 382 826 894 383 208 65 364 726 10 752 396 676 684 347 591 760 46 314 235 676 988 488 197 772 182 759 509 607 74 512 306 86 658 369 754 354 661 260 98 105 626 736 878 719 54 144 564 55 548 603 181 177 260 426 503 739 111 210 143 678 72 372 490 648 402 731 196 785 441 86 590 991 310 909 437 315 451 579 188 864 196 198 42 465 649 635 672 72 884 789 197 290 325 324 636 869 955 689 508 351 548 611 897 176 103 633 190 235 455 360 914 710 84 972 796 695 278 164 111 775 379 835 916 114 125 881 213 419 251 825 45 67 332 434 945 46 313 198 767 810 518 425 340 567 65 992 541 639 114 394 475 638 127 862 591 192 270 84 668 594 39 413 864 917 463 908 21 200 589 702 561 166 112 935 754 468 573 185 508 547 709 76 933 379 801 787 486 468 785 860 56 505 941 990 733 87 52 120 433 224 454 761 963 187 650 143 484 402 535 947 679 863 321 371 853 183 417 232 9 298 668 529 724 806 838 129 996 291 410 124 848 137 787 524 82 686 678 643 546 993 869 198 528 294 942 403 418 164 733 386 614 426 147 925 555 452 96 897 805 697 960 928 812 978 777 507 466 319 826 503 93 468 50 367 370 718 709 806 667 222 362 936 950 939 966 654 246 995 118 504 215 950 785 738 935 71 816 747 297 699 47 769 166 406 274 836 827 444 224 783 460 825 89 565 739 685 179 979 155 918 724 646 641 792 324 948 260 441 861 770 578 255 605 852 243 776 694 304 897 320 249 161 870 192 897 516 900 678 979 830 182 497 876 39 179 782 715 391 306 893 752 874 819 294 351 295 95 756 239 615 156 184 315 962 502 389 198 724 407 962 30 451 214 708 220 644 291 608 279 344 284 247 982 231 693 799 753 414 432 842 518 505 550 172 716 959 232 834 773 7 385 456 831 170 612 657 975 82 352 506 651 779 990 240 427 303 197 446 207 325 864 738 306 812 318 365 394 758 881 715 914 834 947 268 592 795 255 56 637 744 558 268 52 381 879 584 535 77 791 338 111 845 647 535 110 607 523 284 227 866 307 814 283 152 268 981 134 149 630 230 33 86 706 350 209 805 805 684 469 616 27 973 213 771 745 667 318 786 690 740 206 273 428 246 967 785 396 417 308 226 475 157 193 624 328 581 419 700 944 518 705 423 174 922 722 42 681 166 428 586 66 524 9 33 665 603 246 892 305 368 428 475 473 46 561 113 688 967 257 978 393 173 595 123 317 740 697 279 695 691 863 553 989 448 469 352 317 11 571 995 679 800 232 719 497 949 36 424 155 92 427 841 938 548 380 969 459 592 198 199 700 841 867 450 871 234 435 680 358 598 238 82 945 35 858 199 903 909 347 602 420 615 261 62 509 713 161 648 102 110 712 414 544 265 977 602 295 749 530 300 162 872 283 257 33 398 339 249 377 145 256 629 95 374 359 18 795 427 327 922 816 962 345 107 62 46 588 187 725 90 299 933 649 505 72 477 382 842 118 95 832 762 99 368 162 575 873 978 555 315 947 570 306 652 285 86 442 873 92 969 324 11 261 837 367 32 107 843 683 46 84 287 856 515 150 203 790 584 944 145 84 217 606 157 455 43 35 717 382 500 97 963 400 208 344 913 985 958 532 957 857 481 627 265 208 88 328 868 17 824 771 950 369 176 210 114 862 93 913 235 550 992 238 558 945 941 221 317 725 778 851 857 774  `gY  Result 1-`@z cREVGeneral revUniqueID 1024382513763  Scripting for speed 1. use variables not fields 2. use 'repeat for each' !3. don't show progress too often "4. convert long lists into arrays 5. refer to cards, don't go 6. set the default stack  1015580  501673  501673  Done  Result 2-`@z cREVGeneral revUniqueID 1250153091891  Scripting for speed 1. use variables not fields 2. use 'repeat for each' !3. don't show progress too often "4. convert long lists into arrays 5. refer to cards, don't go 6. set the default stack  1015580  501673  501673  Done Time 1-`@z cREVGeneral revUniqueID 1250153091892  12 ticks  81 ticks  28 ticks  22 ticks  228 ticks Time 2-`@z cREVGeneral revUniqueID 1250153091893  0 ticks  2 ticks  3 ticks  2 ticks  1 ticks  New Field 1 F cREVGeneral revUniqueID 1024382562111 Replicates: Reps-pon closeField end closeField @V8 cMinValue1 cMaxValue1000 cREVGeneralscriptChecksumeԒP94&QD revUniqueID 1024382581899 bookmarks handlerList closeField tempScript prevHandlerscriptSelection char 14 to 13scriptG

on closeField

end closeField

 15  10  100  100  3Little Arrows"B local lTrackingIcon, lTracking, lCancelID on mouseUp cancel lCancelID put false into lTracking set the icon of me to the cIcon of me end mouseUp on mouseDoubleUp mouseUp end mouseDoubleUp on mouseDoubleDown mouseDown end mouseDoubleDown on mouseMove x,y if lTracking then put x,y into tLoc if within (me,tLoc) then if the icon of me is not lTrackingIcon then set the icon of me to lTrackingIcon if lTrackingIcon is the cUpIcon of me then hAddToField else if lTrackingIcon is the cDownIcon of me then hSubtractFromField end if else set the icon of me to the cIcon of me end if end if end mouseMove on mousedown put the mouseV into mv if mv < the top of me then add 26 to mv if mv < (the top of me + 10) then put the cUpIcon of me into lTrackingIcon else put the cDownIcon of me into lTrackingIcon set the icon of me to lTrackingIcon if lTrackingIcon is the cUpIcon of me then hAddToField else if lTrackingIcon is the cDownIcon of me then hSubtractFromField put true into lTracking if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 250 milliseconds put the result into lCancelID end mousedown on hTimeMove if not lTracking then exit hTimeMove if the icon of me is the cUpIcon of me then hAddToField else if the icon of me is the cDownIcon of me then hSubtractFromField if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 50 milliseconds put the result into lCancelID end hTimeMove on mouseRelease mouseUp end mouseRelease on hAddToField if the text of the fld (the cTargetField of me) < the cMaxValue of fld (the cTargetField of me) then add 1 to fld (the cTargetField of me) send "closeField" to fld (the cTargetField of me) end hAddToField on hSubtractFromField if the text of the fld (the cTargetField of me) > the cMinValue of fld (the cTargetField of me) then subtract 1 from fld (the cTargetField of me) send "closeField" to fld (the cTargetField of me) end hSubtractFromField cUpIcon201319 revButtonfalse cDownIcon201318cIcon201317 cTargetFieldReps revbasicfalsee cREVGeneralscriptChecksumzxcTqgϠ bookmarks revUniqueID 1024382603760 handlerListomouseUp mouseDoubleUp mouseDoubleDown mouseMove mousedown hTimeMove mouseRelease hAddToField hSubtractFromField tempScript prevHandlermouseUpscriptSelectionchar 749 to 748script v

local lTrackingIcon, lTracking, lCancelID

on mouseUp

cancel lCancelID

put false into lTracking

set the icon of me to the cIcon of me

end mouseUp

on mouseDoubleUp

mouseUp

end mouseDoubleUp

on mouseDoubleDown

mouseDown

end mouseDoubleDown

on mouseMove x,y

if lTracking then

put x,y into tLoc

if within (me,tLoc) then

if the icon of me is not lTrackingIcon then

set the icon of me to lTrackingIcon

if lTrackingIcon is the cUpIcon of me then hAddToField

else if lTrackingIcon is the cDownIcon of me then hSubtractFromField

end if

else

set the icon of me to the cIcon of me

end if

end if

end mouseMove

on mousedown

put the mouseV into mv

if mv < the top of me then add 26 to mv

if mv < (the top of me + 10) then put the cUpIcon of me into lTrackingIcon

else put the cDownIcon of me into lTrackingIcon

set the icon of me to lTrackingIcon

if lTrackingIcon is the cUpIcon of me then hAddToField

else if lTrackingIcon is the cDownIcon of me then hSubtractFromField

put true into lTracking

if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 250 milliseconds

put the result into lCancelID

end mousedown

on hTimeMove

if not lTracking then exit hTimeMove

if the icon of me is the cUpIcon of me then hAddToField

else if the icon of me is the cDownIcon of me then hSubtractFromField

if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 50 milliseconds

put the result into lCancelID

end hTimeMove

on mouseRelease

mouseUp

end mouseRelease

on hAddToField

if the text of the fld (the cTargetField of me) < the cMaxValue of fld (the cTargetField of me) then add 1 to fld (the cTargetField of me)

send "closeField" to fld (the cTargetField of me)

end hAddToField

on hSubtractFromField

if the text of the fld (the cTargetField of me) > the cMinValue of fld (the cTargetField of me) then subtract 1 from fld (the cTargetField of me)

send "closeField" to fld (the cTargetField of me)

end hSubtractFromField

     Notes)h@Z2 cREVGeneral revUniqueID 1024382735506  If you need to gather data from other cards, either a single card or a range of cards, it is much quicker to get the data by referring to the card in your script, rather than going to the card and getting the data directly. This works for cards in the same stack or in different stacks. Locking the screen can reduce this effect but it doesn't eliminate it. Locking messages will reduce it a bit further, depending on what preOpenCard, openCard and closeCard handlers you have written. DThese scripts gather the titles of each of the cards in this stack. The speed increase will depend on the number of messages and the complexity of the graphics that need to be drawn on each card.  Sometimes, you can't avoid referring to data by line number. If you have a long list, this can really slow things down but there is an easy solution. Use the 'split' command to convert your list into an array, then you can refer to the elements by number which is far quicker than referring to lines by number. These scripts add up every tenth line of the list at the left. This isn't the best or fastest way to do this particular operation, but it is a good way to demonstrate these alternative techniques. Note that this is only relevant with long lists. Experiment with adjusting the length of the list to see where the array method becomes faster. (In your own scripts, this will be altered by the length of each line as well as the number of lines.)  It is always a good idea to show your users that something is happening, but updating a progress indicator too often will cause a big slow down. This applies to progress bars, text-based progress indicators and busy cursors. KIndeterminate progress indicators (such as animated gif buttons) are fine. kLike the previous test, these scripts add up the column of figures. They use the 'repeat for each' method, but show progress in different ways. Choose either progress bar, text based progress indicators or busy cursor tests. The animated button option just shows & then hides an animated button. In some cases the loop may be too fast for this to display at all. KIt is important to display some signs of progress during a long handler or your users will think your program has crashed. You can't assume that everyone has a fast computer so allow for some sort of progress indicator. It may not get shown very much if the computer is fast enough but will re-assure users with slower processors. When using the animated button, there is no difference in speed between the two techniques. With the other three options, updating every 10th time through the loop means that the script takes approximately one-tenth of the time to run. This indicates that the time taken is directly proportional to the number of times the progress indicator is updated. Reducing that still further will increase speed again. The four radio buttons are arranged in order of speed, with the animated buttons being the fastest solution and the progress bar being the slowest.  QFor looping through a list, "repeat for each" is much faster than "repeat with". These two buttons add up the list of numbers in the column on the left. Both of these routines are quite fast so use the replicates field to increase the number of times each script is performed. This gives a better indication of the relative speeds. ZThe Results fields are just so that you can check that each script gives the same answer.  Perform operations on data in variables rather than directly in fields. If you really have to work with fields, make sure you lock the screen first. These two buttons both put a list of random numbers into the field on the left. This data will be used for later tests, so please make sure you run at least one of these tests. I use 1000 numbers, but feel free to change this to any number that is big enough to give significant results without taking too long. Each test also allows you to set the number of times it will be repeated, which also helps to adjust the various tests to give meaningful results. `[  New Field 2 >7 cREVGeneral revUniqueID 1024382832633 Results  New Field 2 5J cREVGeneral revUniqueID 1250153091894 Time takenNextCP"on mouseUp go next end mouseUp d cREVGeneralscriptChecksum}Ou$n/ revUniqueID 1024383616230 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 21 to 20scripto

on mouseUp

go next

end mouseUp

PrevCP"on mouseUp go prev end mouseUp 8  cREVGeneralscriptChecksum?N~]=d~ bookmarks revUniqueID 1250153091895 handlerListmouseUpscriptSelection char 21 to 20 prevHandlermouseUp tempScriptscripto

on mouseUp

go prev

end mouseUp

IndexCP%on mouseUp go to cd 1 end mouseUp & q4U cREVGeneralscriptChecksumwMgC i> bookmarks revUniqueID 1250153091896 handlerListmouseUpscriptSelection char 24 to 23 prevHandlermouseUp tempScriptscriptr

on mouseUp

go to cd 1

end mouseUp

 Script 1epon mouseUp put fld "Reps" into repCount put the ticks into startTicks if the hilite of btn "Lock screen" then lock screen put fld "Test numbers" into tCount repeat repCount times -- start of main timing script put empty into fld "Data" repeat tCount times put random(tCount) & return after fld "Data" end repeat -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 1" put "Done" into fld "Result 1" beep end mouseUp 'p"6Field cREVGeneralscriptChecksumU"L}(`I艮 bookmarks revUniqueID 1024459810306 handlerListmouseUpscriptSelectionchar 197 to 196 prevHandlermouseUp tempScriptscript

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

if the hilite of btn "Lock screen" then lock screen

put fld "Test numbers" into tCount

repeat repCount times

-- start of main timing script

put empty into fld "Data"

repeat tCount times

put random(tCount) & return after fld "Data"

end repeat

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 1"

put "Done" into fld "Result 1"

beep

end mouseUp

 Script 2epon mouseUp put fld "Reps" into repCount put the ticks into startTicks put fld "Test numbers" into tCount repeat repCount times -- start of main timing script put empty into theVar repeat tCount times put random(tCount) & return after theVar end repeat put theVar into fld "Data" -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 2" put "Done" into fld "Result 2" beep end mouseUp 'p"6 Variable cREVGeneralscriptChecksum(hB' bookmarks revUniqueID 1024459816879 handlerListmouseUpscriptSelectionchar 112 to 111 prevHandlermouseUp tempScriptscript

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

put fld "Test numbers" into tCount

repeat repCount times

-- start of main timing script

put empty into theVar

repeat tCount times

put random(tCount) & return after theVar

end repeat

put theVar into fld "Data"

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 2"

put "Done" into fld "Result 2"

beep

end mouseUp

 Script 1epon mouseUp put fld "Reps" into repCount put the ticks into startTicks repeat repCount times -- start of main timing script put 0 into theTotal put fld "Data" into theList repeat with x = 1 to the number of lines in theList add line x of theList to theTotal end repeat -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 1" put theTotal into fld "Result 1" beep end mouseUp 'p"U Repeat with cREVGeneralscriptChecksum|>q|; bookmarks revUniqueID 1024459810306 handlerListmouseUpscriptSelection char 75 to 74 prevHandlermouseUp tempScriptscript9

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

repeat repCount times

-- start of main timing script

put 0 into theTotal

put fld "Data" into theList

repeat with x = 1 to the number of lines in theList

add line x of theList to theTotal

end repeat

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 1"

put theTotal into fld "Result 1"

beep

end mouseUp

 Script 2epon mouseUp put fld "Reps" into repCount put the ticks into startTicks repeat repCount times -- start of main timing script put 0 into theTotal put fld "Data" into theList repeat for each line L in theList add L to theTotal end repeat -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 2" put theTotal into fld "Result 2" beep end mouseUp 'p"SRepeat for each cREVGeneralscriptChecksum_pJL a bookmarks revUniqueID 1024459816879 handlerListmouseUpscriptSelectionchar 389 to 388 prevHandlermouseUp tempScriptscript

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

repeat repCount times

-- start of main timing script

put 0 into theTotal

put fld "Data" into theList

repeat for each line L in theList

add L to theTotal

end repeat

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 2"

put theTotal into fld "Result 2"

beep

end mouseUp

 Script 1epon mouseUp put fld "Reps" into repCount put the ticks into startTicks if the hilite of btn "Progress bar" then put true into showBar else put false into showBar if the hilite of btn "Text based" then put true into showText else put false into showText if the hilite of btn "Busy cursor" then put true into showCursor else put false into showCursor if the hilite of btn "Anim. button" then show btn "Anim 1" show btn "Anim 2" end if repeat repCount times set the thumbpos of sb "Progress" to 0 -- start of main timing script put 0 into counter put 0 into theTotal put fld "Data" into theList repeat for each line L in theList add L to theTotal add 1 to counter if showbar then set the thumbpos of sb "Progress" to counter else if showText then put counter & " of 1000" into fld "Progress" else if showCursor then set the cursor to busy end if end repeat -- end of main timing script end repeat hide btn "Anim 1" hide btn "Anim 2" put the ticks - startTicks & " ticks" into fld "Time 1" put theTotal into fld "Result 1" beep end mouseUp 'p"Qupdate every loop cREVGeneralscriptChecksumVW>kߥP bookmarks revUniqueID 1024459810306 handlerListmouseUpscriptSelectionchar 890 to 889 prevHandlermouseUp tempScriptscript b

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

if the hilite of btn "Progress bar" then put true into showBar

else put false into showBar

if the hilite of btn "Text based" then put true into showText

else put false into showText

if the hilite of btn "Busy cursor" then put true into showCursor

else put false into showCursor

if the hilite of btn "Anim. button" then

show btn "Anim 1"

show btn "Anim 2"

end if

repeat repCount times

set the thumbPos of sb "Progress" to 0

-- start of main timing script

put 0 into counter

put 0 into theTotal

put fld "Data" into theList

repeat for each line L in theList

add L to theTotal

add 1 to counter

if showbar then set the thumbPos of sb "Progress" to counter

else if showText then put counter & " of 1000" into fld "Progress"

else if showCursor then set the cursor to busy

end repeat

-- end of main timing script

end repeat

hide btn "Anim 1"

hide btn "Anim 2"

put the ticks - startTicks & " ticks" into fld "Time 1"

put theTotal into fld "Result 1"

beep

end mouseUp

 Script 2epon mouseUp put fld "Reps" into repCount put the ticks into startTicks if the hilite of btn "Progress bar" then put true into showBar else put false into showBar if the hilite of btn "Text based" then put true into showText else put false into showText if the hilite of btn "Busy cursor" then put true into showCursor else put false into showCursor if the hilite of btn "Anim. button" then show btn "Anim 1" show btn "Anim 2" end if repeat repCount times set the thumbPos of sb "Progress" to 0 -- start of main timing script put 0 into counter put 0 into theTotal put fld "Data" into theList repeat for each line L in theList add L to theTotal add 1 to counter if counter mod 10 = 0 then if showbar then set the thumbPos of sb "Progress" to counter else if showText then put counter & " of 1000" into fld "Progress" else if showCursor then set the cursor to busy end if end repeat -- end of main timing script end repeat hide btn "Anim 1" hide btn "Anim 2" put the ticks - startTicks & " ticks" into fld "Time 2" put theTotal into fld "Result 2" beep end mouseUp 'p"Qupdate every 10 cREVGeneralscriptChecksumrH bookmarks revUniqueID 1024459816879 handlerListmouseUpscriptSelectionchar 1090 to 1089 prevHandlermouseUp tempScriptscript

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

if the hilite of btn "Progress bar" then put true into showBar

else put false into showBar

if the hilite of btn "Text based" then put true into showText

else put false into showText

if the hilite of btn "Busy cursor" then put true into showCursor

else put false into showCursor

if the hilite of btn "Anim. button" then

show btn "Anim 1"

show btn "Anim 2"

end if

repeat repCount times

set the thumbPos of sb "Progress" to 0

-- start of main timing script

put 0 into counter

put 0 into theTotal

put fld "Data" into theList

repeat for each line L in theList

add L to theTotal

add 1 to counter

if counter mod 10 = 0 then

if showbar then set the thumbPos of sb "Progress" to counter

else if showText then put counter & " of 1000" into fld "Progress"

else if showCursor then set the cursor to busy

end if

end repeat

-- end of main timing script

end repeat

hide btn "Anim 1"

hide btn "Anim 2"

put the ticks - startTicks & " ticks" into fld "Time 2"

put theTotal into fld "Result 2"

beep

end mouseUp

 Progressaa^ revscrollbarfalse??1000 cREVGeneral revUniqueID 1024470230221 i&l^ cREVGeneral revUniqueID 1024470591772 Progress bar`D^on mouseUp put 1 into fld "Reps" hide fld "Progress" show sb "Progress" end mouseUp *`dctRevID 1250153274 cREVGeneralscriptChecksum3|醮whz,E revUniqueID 1024470559271 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 11 to 10script

on mouseUp

hide fld "Progress"

show sb "Progress"

end mouseUp

 Text based`D^on mouseUp put 5 into fld "Reps" show fld "Progress" hide sb "Progress" end mouseUp *KdctRevID 1250153250 cREVGeneralscriptChecksum^F5Iۀq revUniqueID 1250153091897 bookmarks handlerListmouseUp tempScript prevHandlerscriptSelection char 40 to 39script

on mouseUp

show fld "Progress"

hide sb "Progress"

end mouseUp

 Busy cursor`D_on mouseUp put 10 into fld "Reps" hide fld "Progress" hide sb "Progress" end mouseUp *5dctRevID 1250153265 cREVGeneralscriptChecksum~Aa5mZ{!&j bookmarks revUniqueID 1250153091898 handlerListmouseUpscriptSelection char 18 to 17 prevHandlermouseUp tempScriptscript

on mouseUp

hide fld "Progress"

hide sb "Progress"

end mouseUp

 Anim. button`D`on mouseUp put 100 into fld "Reps" hide fld "Progress" hide sb "Progress" end mouseUp * dctRevID 1250153101 cREVGeneralscriptChecksum~Aa5mZ{!&j bookmarks revUniqueID 1250153091899 handlerListmouseUpscriptSelection char 40 to 39 prevHandlermouseUp tempScriptscript

on mouseUp

hide fld "Progress"

hide sb "Progress"

end mouseUp

  Progress#`\d cREVGeneral revUniqueID 1024470617466  1000 of 1000Anim 1C"X 04 cREVGeneral revUniqueID 1024471227941 Anim 2C"Xd04 cREVGeneral revUniqueID 1024471267172  Script 1epNon mouseUp put fld "Reps" into repCount put the ticks into startTicks -- make the list longer to start with put empty into theList repeat fld "List length" times put fld "Data" after theList end repeat repeat repCount times -- start of main timing script put 0 into theTotal repeat with x = 1 to the number of lines in theList step 10 add line x of theList to theTotal end repeat -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 1" put theTotal into fld "Result 1" beep end mouseUp 'p"Ulist cREVGeneralscriptChecksumRlh~{`F6N bookmarks revUniqueID 1024459810306 handlerListmouseUpscriptSelectionchar 353 to 352 prevHandlermouseUp tempScriptscriptb

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

-- make the list longer to start with

put empty into theList

repeat fld "List length" times

put fld "Data" after theList

end repeat

repeat repCount times

-- start of main timing script

put 0 into theTotal

repeat with x = 1 to the number of lines in theList step 10

add line x of theList to theTotal

end repeat

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 1"

put theTotal into fld "Result 1"

beep

end mouseUp

 Script 2epjon mouseUp put fld "Reps" into repCount put the ticks into startTicks -- make the list longer to start with put empty into theList repeat fld "List length" times put fld "Data" after theList end repeat split theList with return repeat repCount times -- start of main timing script put 0 into theTotal repeat with x = 1 to the number of lines in the keys of theList step 10 add theList[x] to theTotal end repeat -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 2" put theTotal into fld "Result 2" beep end mouseUp 'p"Sarray cREVGeneralscriptChecksum1ahtId5 l% bookmarks revUniqueID 1024459816879 handlerListmouseUpscriptSelectionchar 174 to 173 prevHandlermouseUp tempScriptscript

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

-- make the list longer to start with

put empty into theList

repeat fld "List length" times

put fld "Data" after theList

end repeat

split theList with return

repeat repCount times

-- start of main timing script

put 0 into theTotal

repeat with x = 1 to the number of lines in the keys of theList step 10

add theList[x] to theTotal

end repeat

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 2"

put theTotal into fld "Result 2"

beep

end mouseUp

 List length-pon closeField end closeField @VZ8 cMinValue1 cMaxValue50 cREVGeneralscriptChecksumeԒP94&QD revUniqueID 1024382581899 bookmarks handlerList closeField tempScript prevHandlerscriptSelection char 14 to 13scriptG

on closeField

end closeField

 20Little Arrows"B local lTrackingIcon, lTracking, lCancelID on mouseUp cancel lCancelID put false into lTracking set the icon of me to the cIcon of me end mouseUp on mouseDoubleUp mouseUp end mouseDoubleUp on mouseDoubleDown mouseDown end mouseDoubleDown on mouseMove x,y if lTracking then put x,y into tLoc if within (me,tLoc) then if the icon of me is not lTrackingIcon then set the icon of me to lTrackingIcon if lTrackingIcon is the cUpIcon of me then hAddToField else if lTrackingIcon is the cDownIcon of me then hSubtractFromField end if else set the icon of me to the cIcon of me end if end if end mouseMove on mousedown if the mouseV < (the top of me + 10) then put the cUpIcon of me into lTrackingIcon else put the cDownIcon of me into lTrackingIcon set the icon of me to lTrackingIcon if lTrackingIcon is the cUpIcon of me then hAddToField else if lTrackingIcon is the cDownIcon of me then hSubtractFromField put true into lTracking if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 250 milliseconds put the result into lCancelID end mousedown on hTimeMove if not lTracking then exit hTimeMove if the icon of me is the cUpIcon of me then hAddToField else if the icon of me is the cDownIcon of me then hSubtractFromField if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 50 milliseconds put the result into lCancelID end hTimeMove on mouseRelease mouseUp end mouseRelease on hAddToField if the text of the fld (the cTargetField of me) < the cMaxValue of fld (the cTargetField of me) then add 1 to fld (the cTargetField of me) send "closeField" to fld (the cTargetField of me) end hAddToField on hSubtractFromField if the text of the fld (the cTargetField of me) > the cMinValue of fld (the cTargetField of me) then subtract 1 from fld (the cTargetField of me) send "closeField" to fld (the cTargetField of me) end hSubtractFromField ZcUpIcon201319 revButtonfalse cDownIcon201318cIcon201317 cTargetField List length revbasicfalsee cREVGeneralscriptChecksum(LV` bookmarks revUniqueID 1024382603760 handlerListomouseUp mouseDoubleUp mouseDoubleDown mouseMove mousedown hTimeMove mouseRelease hAddToField hSubtractFromField tempScript prevHandlermouseUpscriptSelectionchar 1771 to 1770script   New Field 1 Z cREVGeneral revUniqueID 1024382562111 %Length of list (thousands of lines): Script 1epYon mouseUp put fld "Reps" into repCount put the ticks into startTicks if the hilite of btn "Lock screen" then lock screen if the hilite of btn "Lock messages" then lock messages push card go to card 1 repeat repCount times -- start of main timing script put empty into cardList repeat the number of cards times put fld "Title" & return after cardList go next end repeat -- end of main timing script end repeat pop card put the ticks - startTicks & " ticks" into fld "Time 1" put cardList into fld "Result 1" beep end mouseUp 'p"W Go to card cREVGeneralscriptChecksumR|q~#p bookmarks revUniqueID 1024459810306 handlerListmouseUpscriptSelectionchar 488 to 487 prevHandlermouseUp tempScriptscript

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

if the hilite of btn "Lock screen" then lock screen

if the hilite of btn "Lock messages" then lock messages

push card

go to card 1

repeat repCount times

-- start of main timing script

put empty into cardList

repeat the number of cards times

put fld "Title" & return after cardList

go next

end repeat

-- end of main timing script

end repeat

pop card

put the ticks - startTicks & " ticks" into fld "Time 1"

put cardList into fld "Result 1"

beep

end mouseUp

 Lock screen`ERY cREVGeneral revUniqueID 1024383338927  Script 2epon mouseUp put fld "Reps" into repCount put the ticks into startTicks if the hilite of btn "Lock screen" then lock screen repeat repCount times -- start of main timing script put empty into cardList repeat with x = 1 to the number of cards put fld "Title" of cd x & return after cardList end repeat -- end of main timing script end repeat put the ticks - startTicks & " ticks" into fld "Time 2" put cardList into fld "Result 2" beep end mouseUp 'p"URefer to card cREVGeneralscriptChecksumCyĪE$ bookmarks revUniqueID 1024459816879 handlerListmouseUpscriptSelectionchar 323 to 322 prevHandlermouseUp tempScriptscriptc

on mouseUp

put fld "Reps" into repCount

put the ticks into startTicks

if the hilite of btn "Lock screen" then lock screen

repeat repCount times

-- start of main timing script

put empty into cardList

repeat with x = 1 to the number of cards

put fld "Title" of cd x & return after cardList

end repeat

-- end of main timing script

end repeat

put the ticks - startTicks & " ticks" into fld "Time 2"

put cardList into fld "Result 2"

beep

end mouseUp

Lock messages`Edj cREVGeneral revUniqueID 1024383338927 Top boxK`333ff6N cREVGeneral revUniqueID 1024351876797 Title  ff@6LSelection Descriptionfalse cREVGeneral revUniqueID 1024352083638  Scripting for speed !Index' xion mouseUp put word 1 of the selectedText of me into theTitle go to card (theTitle + 1) end mouseUp @l< cREVTable currentview1. use variables not fields 2. use 'repeat for each' 3. don't show progress too often 4. convert long lists into arrays 5. refer to cards, don't go cREVGeneralscriptChecksumB=Hat# xK bookmarks revUniqueID 1024370300013 handlerListmouseUpscriptSelection char 93 to 92 prevHandler tempScriptscript1

on mouseUp

put word 1 of the selectedText of me into theTitle

go to card (theTitle + 1)

end mouseUp

 1. use variables not fields 2. use 'repeat for each' !3. don't show progress too often "4. convert long lists into arrays 5. refer to cards, don't go #Notes)h@Z Selection Descriptionfalse cREVGeneral revUniqueID 1024382735506  This stack contains a set of scripting tricks to increase the speed of your Revolution applications. In Revolution (as with all xTalks) there are often many different ways of arriving at the same result. If you are writing a one-use utility for yourself, it probably doesn't matter if it is the most efficient script possible, but if you are writing an application for publication or for long-term use, you want to make sure that the long handlers are sped up as much as possible. NThe listed techniques show some of the most effective ways to increase speed. Some of these techniques have been learnt over many years of programming in HyperCard, but others are specific to Revolution. Thanks to all the members of the Revolution list for their advice on these and other matters. Sarah Reichelt sarah@troz.net$ `[ 3 New Field 1 jVX cREVGeneral revUniqueID 1024382562111 Test numbers: 4 Test numbers-pon closeField end closeField @V8 cMinValue100 cMaxValue10000 cREVGeneralscriptChecksumeԒP94&QD revUniqueID 1024382581899 bookmarks handlerList closeField tempScript prevHandler closeFieldscriptSelection char 14 to 13scriptG

on closeField

end closeField

 10005Little Arrows"B local lTrackingIcon, lTracking, lCancelID on mouseUp cancel lCancelID put false into lTracking set the icon of me to the cIcon of me end mouseUp on mouseDoubleUp mouseUp end mouseDoubleUp on mouseDoubleDown mouseDown end mouseDoubleDown on mouseMove x,y if lTracking then put x,y into tLoc if within (me,tLoc) then if the icon of me is not lTrackingIcon then set the icon of me to lTrackingIcon if lTrackingIcon is the cUpIcon of me then hAddToField else if lTrackingIcon is the cDownIcon of me then hSubtractFromField end if else set the icon of me to the cIcon of me end if end if end mouseMove on mousedown if the mouseV < (the top of me + 10) then put the cUpIcon of me into lTrackingIcon else put the cDownIcon of me into lTrackingIcon set the icon of me to lTrackingIcon if lTrackingIcon is the cUpIcon of me then hAddToField else if lTrackingIcon is the cDownIcon of me then hSubtractFromField put true into lTracking if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 250 milliseconds put the result into lCancelID end mousedown on hTimeMove if not lTracking then exit hTimeMove if the icon of me is the cUpIcon of me then hAddToField else if the icon of me is the cDownIcon of me then hSubtractFromField if "hTimeMove" is not in the pendingMessages then send "hTimeMove" to me in 50 milliseconds put the result into lCancelID end hTimeMove on mouseRelease mouseUp end mouseRelease on hAddToField if the text of the fld (the cTargetField of me) < the cMaxValue of fld (the cTargetField of me) then add 1 to fld (the cTargetField of me) send "closeField" to fld (the cTargetField of me) end hAddToField on hSubtractFromField if the text of the fld (the cTargetField of me) > the cMinValue of fld (the cTargetField of me) then subtract 1 from fld (the cTargetField of me) send "closeField" to fld (the cTargetField of me) end hSubtractFromField VcUpIcon201319 revButtonfalse cDownIcon201318cIcon201317 cTargetField Test Numbers revbasicfalsee cREVGeneralscriptChecksum(LV` bookmarks revUniqueID 1024382603760 handlerListomouseUp mouseDoubleUp mouseDoubleDown mouseMove mousedown hTimeMove mouseRelease hAddToField hSubtractFromField tempScript prevHandlermouseUpscriptSelectionchar 1771 to 1770script