REVO2700 5 Speed 2 @ d g6 revstack false Oon preOpenCard set the vScroll of fld "Notes" to 0 end preOpenCard 4 Speed tests U Arial Black U Arial Black W Arial Black W Arial Black U Lucida Grande U Lucida Grande U Lucida Grande cRevStandaloneSettings CscriptLibraries Internet Geometry PrintingMacOSX falseMacOS,documentType UNIX,fileSelector trueWeb,WindowsSupported trueWindows falseWindows,LegalCopyright #2009 All rights reserved worldwideUNIX,pageSetup trueWeb trueWeb,LinuxSupported true answerDialog trueWindows,FileDescription Speed 1.0.0.0 for WindowsOSX,longVersion Speed 1.0.0.0Web,RequestedName OSX,copyright #2009 All rights reserved worldwideWindows,buildU3 falseWeb,CustomBackgroundColor 237,237,237Web,CustomLoadIcon MacOS,versionnumber1 1MacOS,Release FinalMacOS,versionnumber2 0MacOS,versionnumber3 0name SpeedOSX,identifier com..speedWeb,InstanceId OSX,shortVersion 1.0.0.0Windows,fileversion1 1Windows,fileversion2 0Windows,fileversion3 0Windows,fileversion4 0cursors falseWeb,MacOSXSupported trueMacOS,dynamicMemory trueMacOSX PowerPC-32 false Windows,UUID $9DACB581-3C1E-469D-9BE0-56B7B3FD1F38MacOS,PreferredSize 15000MacOS,creator ???? OSX,name SpeedMacOS,longVersion Speed 1.0.0.0OSX,documentType Web,MinEnvironmentVersion Windows,documenticonFile i/Applications/Revolution Enterprise/4.0.0-dp-3/Runtime/Windows/x86-32/Support/Sample Icons/genericdoc.icoinclusions searchWeb,Domain 0xFFOSX,documentExtension Web,AllowOtherPlatforms trueWeb,DetectSecurityPermissions trueUNIX,printerChooser trueWeb,SecurityPermissions ,,,,,,,,MacOS,MinimumSize 15000 MacOS,Region 1Windows,productversion1 1Windows,productversion2 0Windows,productversion3 0 OSX,info Speed Version 1.0.0.0Windows,productversion4 0Web,ExecutionMode BrowserWeb,CustomBackgroundColor2 237,237,237 askDialog trueWindows,iconFile i/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,ProductName SpeeddefaultBuildFolder /Users/sarahtim/DesktopUNIX,colorChooser trueMacOSX x86-32 falseWindows,companyname cREVGeometryCache stackID 1077 cREVGeneral scriptChecksum *NlQΤ bookmarks handlerList preOpenCardtempScript prevHandler resizeStackscriptSelection char 53 to 52script
on preOpenCard
set the vScroll of fld "Notes" to 0
end preOpenCard
@ 6 ! # card id 1002 @ 6 3 4 5 @ 6 cREVGeneral scriptChecksum ُ B~ bookmarks handlerList tempScript prevHandler scriptSelection char 1 to 0script @ 6 cREVGeometryCacheIDs 1024459816879 10311024382562111 10141250153091891 10111024382832633 10191250153091892 10121024383888108 10251250153091893 10131250153091894 10201250153091895 10231250153091896 10241250153091897 10341250153091898 10381250153091899 10391024382513763 10101024470617466 10361024370300013 10061024470591772 10351024382603760 10161024459810306 10301024352281591 10051024471267172 10411024470230221 10321024382581899 10151024352083638 10041024471227941 10401024351876797 10031024382735506 10171024470559271 10331024383616230 1022 cREVGeometrycache order total 29 @ 6 @ 6 Lock screen `E R Y cREVGeneral revUniqueID 1024383338927 > cREVGeneral revUniqueID 1024383888108 List box K` 3 J cREVGeneral revUniqueID 1024352281591 Top box K` 3 33ff 6 N cREVGeneral revUniqueID 1024351876797 Title ff @ 6 N 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 ` @ X j 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 ` g Y 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 -p on closeField end closeField @V 8 cMinValue 1 cMaxValue 1000 cREVGeneral scriptChecksum eԒP94&QDrevUniqueID 1024382581899 bookmarks handlerList closeFieldtempScript prevHandler scriptSelection char 14 to 13script Gon closeField
end closeField
15 10 100 100 3 Little 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 cUpIcon 201319 revButton false cDownIcon 201318cIcon 201317 cTargetField Reps revbasic false e cREVGeneral scriptChecksum zxcTqgϠ bookmarks revUniqueID 1024382603760handlerList omouseUp mouseDoubleUp mouseDoubleDown mouseMove mousedown hTimeMove mouseRelease hAddToField hSubtractFromFieldtempScript prevHandler mouseUpscriptSelection char 749 to 748script vlocal 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 @ Z 2 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 5 J cREVGeneral revUniqueID 1250153091894 Time taken Next CP "on mouseUp go next end mouseUp d cREVGeneral scriptChecksum }Ou$n/revUniqueID 1024383616230 bookmarks handlerList mouseUptempScript prevHandler scriptSelection char 21 to 20script oon mouseUp
go next
end mouseUp
Prev CP "on mouseUp go prev end mouseUp 8 cREVGeneral scriptChecksum ?N~ ]=d~ bookmarks revUniqueID 1250153091895handlerList mouseUpscriptSelection char 21 to 20prevHandler mouseUptempScript script oon mouseUp
go prev
end mouseUp
Index CP %on mouseUp go to cd 1 end mouseUp &