View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default VBA Example of Using WHILE and LOOP?

"Mike" wrote:
It is not exactly plain WHILE/Loop. Let me write
you how I have the While Loop thing:

WHILE( ( PlnHrznTop <= CARD(ts))
AND Continue < 0)),
!! t is the first time period in the upcoming solve
LOOP( t with condition that (ORD(t) = PlnHrznTop),


"Mike" wrote:
My WHILE/LOOP structure is as follows:
WHILE condition1 and condition2

LOOP over t while condition3 as below:
WHILE( PlnHrznTop <= ts
AND Continue < 0),
LOOP( t while (ORD(t) = PlnHrznTop),


I do not understand your pseudocode. I don't know if ts and t are intended
to be the same (typo?) or different. Unless you can write your pseudocode
or algorithm clearly, it is hopeless to try to help you.

Here are some ideas that might be helpful. Then again, maybe not.

If PlnHrznTop <= ts And Continue < 0 Then
Do
[...some code...]
Loop While ORD(t) = PlnHrznTop
End If

--or--

Do While PlnHrznTop <= ts And Continue < 0
[...some code...]
If ORD(t) = PlnHzrnTop Then Exit Do
[...some more code...]
Loop