Re: Visualbasic memory crash



Thanks for the fast reply mr. Altenbach.


I have allready changed some things in the program like naming the controls,indicators etc etc.


The main program is almost impossible to troubleshoot, but here are a few things I noticed:
 
- The loop in the upper right has no delay. How fast will it run? (Sorry, I don't have ieldPoint)
I made some delay´s in the other loops.



- You have quite a few controls that have the same name and thus
their local variables look the same (e.g. "mail function", "HPC
Actief", "stop", etc.) This makes troubleshooting virtually impossible!
I renamed the controls, indicators etc etc the proper way.


- You open an excel reference (at i=0 OR button press) but you never
close it! Whenever (i=0 OR button press) is FALSE, you get an empty
reference (use default if unwired) for the rest of the code! You need
to keep the open reference in a shift register so it is available in
subsequent iterations of the loop. At the end of the program, you
should close the reference.
Removed is from the program.


- There are many painfully complex constructs. To turn a scalar into
a 1x1 2D array, you probably don't need an autoindexing FOR loop with
one iteration, followed by built array and transpose array. You could
just use two "built array" in sequence, or "initialize array".
Transposing a 1x1 array does nothing, right?&nbsp;<img src="../../i/smilies/16x16_robot-wink.gif" border="0" height="16" width="16">.
Then you feed this 1x1 array into two autoindexing FOR loops to write
the cell value. To supress writing, you force the outer iteration count
to zero(!) using an extra&nbsp;case structure. The right way would be to
place it all into a case strucure and, if true, write the formatted
scalar to the desired cell while the false case is empty. Look Ma, no
loops! (or arrays).
I try to get it clean now that it is simple to look over and easy to handle for the system





Thank you

William Strijks
Kinzo B.V.
Holland
.



Relevant Pages

  • Loops performance contradictions.
    ... happen on each iteration (unless it will change during the loop). ... Creating an array of length 0x3B9ACA0. ... Set the array data in about 3438380 ticks. ...
    (microsoft.public.dotnet.framework.performance)
  • Re: How to create descendants of Array class?
    ... show up in a for-in loop and similar operations, ... The augmented array facilities direct indexed looping and maintains its ... aggregated through a reference to it by the aggregating ... object's property) would allow clean for-in iteration of the ...
    (comp.lang.javascript)
  • Re: Why is array pushed in thread sub not set after join?
    ... I have a loop where each iteration makes 5 independent REST calls. ... resulting array. ...
    (comp.lang.perl.misc)
  • Re: How to dynamically resize an array?
    ... The man said that he will resize the array once! ... even if he does want to resize it more than once he very definitely never said that he was goiung to resize it at every iteration of the loop. ...
    (microsoft.public.dotnet.languages.vb)
  • Yow! LOOP macros are LOOPY!
    ... By relying entirely on procedure calls to express iteration, ... to but cleaner than C's FOR loop. ... other macros going around at the time other than MacLisp's ... (bind (vi (vector-ref v i))) ...
    (comp.lang.scheme)