Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

supplier menu problem

Status
Not open for further replies.

FoxStudent

Technical User
Feb 24, 2000
85
GB
What is wrong with this popup menu? It works the first time but when I try to run it the second time it always thinks that the bar is 3 and so does not become activated. I have even tried quitting foxpro and it still does not work. However, I have used the same design for the other four popup menus in this application and they all work fine.<br><br>Thank you,<br>Grainne Evans<br><br>define popup suppmenu from 10,10 to 14,40<br>define bar 1 of suppmenu prompt &quot;&nbsp;&nbsp;Add Supplier&quot;<br>define bar 2 of suppmenu prompt &quot;&nbsp;&nbsp;Supplier Search&quot;<br>define bar 3 of suppmenu prompt &quot;&nbsp;&nbsp;Return to Maintenance Menu&quot;<br>on selection popup suppmenu do exesupp<br>do while bar() &lt;&gt; 3<br> wait wind 'Within the do while loop'<br> set color to n/b<br> clear<br> do titlesupp<br> set color to n/w<br> activate popup suppmenu<br>enddo<br>wait window 'After the do while loop' + str(bar())<br>clear<br><br>procedure titlesupp<br>wait window 'Within the title procedure'<br>set color to n/w+<br>set border to double<br>@4,10 to 8,40<br>@6,24 say &quot;Supplier Menu&quot;<br>set border to<br>set color to n/w<br>return<br><br>procedure exesupp<br>wait window 'Within the execute supplier procedure'<br>do case<br> case bar() = 1<br> hide popup suppmenu<br> do suppadd<br> case bar() = 2<br> hide popup suppmenu<br> do suppsear<br>endcase<br>wait window 'After the end case procedure'<br>clear<br>release all<br>deactivate popup suppmenu<br>clear all<br>return<br><br>procedure suppadd<br>wait window 'In the add routine'<br>return<br><br>procedure suppsear<br>wait window 'In the search routine'<br>return<br>
 
FoxPro help says BAR(): Returns the number of the most recently chosen option from a popup defined with DEFINE POPUP or a FoxPro menu system popup.<br><br>The first time you run this, everything works fine.&nbsp;&nbsp;The culprit is &quot;do while bar() &lt;&gt; 3&quot;.&nbsp;&nbsp;After you run this, by definition the bar() will always be 3 until you do another popup.<br><br>Try this instead:<br><br>define popup suppmenu from 10,10 to 14,40<br>define bar 1 of suppmenu prompt &quot;&nbsp;&nbsp;Add Supplier&quot;<br>define bar 2 of suppmenu prompt &quot;&nbsp;&nbsp;Supplier Search&quot;<br>define bar 3 of suppmenu prompt &quot;&nbsp;&nbsp;Return to Maintenance Menu&quot;<br>on selection popup suppmenu do exesupp<br>STORE .F. TO lSuppMenu&nbsp;&nbsp;&nbsp;&nbsp;&& new variable<br>do while NOT lSuppMenu&nbsp;&nbsp;&nbsp;&nbsp;&& do until lSuppMenu is .T.<br>wait wind 'Within the do while loop'<br>set color to n/b<br>clear<br>do titlesupp<br>set color to n/w<br>activate popup suppmenu<br>enddo<br>wait window 'After the do while loop' + str(bar())<br>clear<br><br>procedure titlesupp<br>wait window 'Within the title procedure'<br>set color to n/w+<br>set border to double<br>@4,10 to 8,40<br>@6,24 say &quot;Supplier Menu&quot;<br>set border to<br>set color to n/w<br>return<br><br>procedure exesupp<br>wait window 'Within the execute supplier procedure'<br>do case<br>case bar() = 1<br>hide popup suppmenu<br>do suppadd<br>case bar() = 2<br>hide popup suppmenu<br>do suppsear<br>CASE BAR() = 3&nbsp;&nbsp;&nbsp;&& add this case<br>STORE .T. TO lSuppMenu<br>endcase<br>wait window 'After the end case procedure'<br>clear<br>release all<br>deactivate popup suppmenu<br>clear all<br>return<br><br>procedure suppadd<br>wait window 'In the add routine'<br>return<br><br>procedure suppsear<br>wait window 'In the search routine'<br>return<br><br> <p>Mike Wood<br><a href=mailto:mwood@awod.com>mwood@awod.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top