Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying Arrays
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00810581
Message ID:
00810626
Views:
24
Sergey, please correct me if I'm wrong but accessing properties is slower than public vars, isn't it? maybe it ani't quite a diference but there is for example
if you store values to forms properties like variables then you are going to get a huge reduction in performace, accessing the a forms properties on a regular basic is very consuming. i know you are not likely to use it for some thing like this but just try this little test. create a new form, add a property called temp, add a command button to your form and copy this code into the click of the command button. first of all run it as it is, time given is time taken when using a variable, then comment out the top code and uncomment the code below and check out the time taken using a forms property. let us know what you think?
public n 
set talk off
n = 1
lnStime = seconds()
do while n < 5000000
   n =n+1
enddo
set talk on
?seconds() - lnStime

*!*   public n 
*!*   set talk off
*!*   thisform.temp = 1
*!*   lnStime = seconds()
*!*   do while thisform.temp < 5000000
*!*      thisform.temp =thisform.temp+1
*!*   enddo
*!*   set talk on
*!*   ?seconds() - lnStime 
quite diferent if you do it like this
public n 
set talk off
thisform.temp = 1
lnStime = seconds()
with thisform
   do while .temp < 5000000
     .temp =.temp+1
  enddo
endwith
set talk on
?seconds() - lnStime 
.......
DO WHILE .T.
      ME.Work()
ENDDO
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform