06-05-2014 04:14 AM
Hello All
I have strucked at one point related to message popups. Request Please guide
1) i am using CONFIRM POP UP to get User selection.
2) the same i will assign it to the variable
next i want to display that variable . can any one help on this. How to display the variable as in POP UP
Thanks
Hussain
06-05-2014 05:08 AM
Have you tried with MessagePopup ()? You will need to format a proper message text since the function accepts only strings; e.g.
sprintf (msg, "Variable value is %d", variable);
MessagePoup ("Variable", msg);
06-05-2014 05:59 AM
Hello
Thanks for the response, I have not updated any thing yet. i will perform this now.
I will follow this format to get what i required
int X;
X = ConfirmPopup ("confirmation", "Does the values are correct format?");
sprintf (msg, "Variable value is %d", X);
MessagePoup ("Variable", msg);
can you Please confirm is this correct format
Hussain
06-05-2014 06:37 AM
I may have misunderstood your previous message.
ConfirmPopup returns only a yes/no response: your X variable will contain 1 if the user pressed Yes, 0 if he pressed No.
There is no way with that function for the user to enter a value and have it returned to the program.
Having said this, your code is correct: it will display a message with the value 0 or 1 depending on user choices.
It's up to you to decide whether this is enough for your needs or you need some more advanced interaction with the user, like for example the one offered by PromptPopup.
06-05-2014 12:21 PM
Hello
Currently i am looking for display of 1 or 0 only.Really appreciate your valuable support.
May i know few examples using promptpopup command
06-05-2014 12:31 PM
Do we need to add any headder file for this ?
06-05-2014 01:37 PM - edited 06-05-2014 01:45 PM
Header file needed? Yes. "userint.h"
06-06-2014 01:53 AM - edited 06-06-2014 01:56 AM
CVI comes plenty of examples that you can look at. You can use the Example Finder (Help >> Find Examples... menu function) and search among the examples installed in your machines or available on NI site. I suggest you take a look at this function as it can save you a lot of time wondering how some function works. This document, even if aimed to examples related to hardware, describes the Example Finder and its available customization.
popup.cws supplied example can be looked at while dealing with several popus offered by CVI environment, including PromptPopup.
With reference to the include file needed, if you are working inside the CVI IDE you have not to worry about that: the IDE will ask you to add all missing includes every time you debug your program.