InputBox
Hello
I use an inputbox for the user to enter a 1 or 0 depending on the option he wants. It works very well.
The problem comes when the user clicks on cancel or closes the dialog box, as I am not able to encode these options.
This is my code:
Dim input
entry = Cint (inputbox ("you want to calculate the offsets (1 = Yes, 0 = NO)"? ', "offsets', 1"))
Make input > 1
entry = Cint (inputbox ("Please enter 1 or 0. You want to calculate the offsets (1 = Yes, 0 = NO)? ((', 'Offsets', 1))
Loop
If entry = 1 then
............
On the other
..........
End if
I found the function "Dlgstate" and I thought to use it to check cancel or close the options dialog box, but it did not work as no matter what I do, the result given by Dlgstate is always the same: "IDcancel.
Can someone tell me what I am doing wrong?
Thank you.
Leo
Hello Leillo,
There are two types of functions in DIAdem, those provided by standard VBS and those provided by DIAdem.
InputBox is a VBS functionand does not use the "DlgState" variable, which is used only by the dialogues of DIAdem.
To answer your question, please check the information below:
The InputBox function displays a dialog box where the user can write comments or click a button. If the user clicks the OK button or press ENTER on the keyboard, the InputBox function returns the text in the text box. If the user clicks the Cancel button, the function will return an empty string ("").
It looks like to looking for an empty string ("" ") you will get the desired result.
Hope that helps - let me know if you have any additional questions,
Otmar
Tags: NI Software
Similar Questions
-
Entry to the inputbox alignment problem number
All,
I have an inputbox bound to a Long field in the t. On the page when I enter the number, the entry is taken from the right side. How will we change it left for numbers like string.
Thnks
11.1.1.5 JdevYou can put
text-align:left;
in the property ContentStyle of the inputText component.
Timo
-
At AcroJS a command like vbs Inputbox?
Hello
I tried something like app.prompt or doc.prompt, but have not found anything comparableto an inputbox.
I think that I saw it somewhere in a pdf document.
Thanks for your help,
Reinhard
App.Response
-
How can I convert an inputbox in a column to textarea?
It seems that it is a button.i to "convert" does notinputtext has a 'lines' property, increasing, it gives you a multi line textarea.
-
How can AF:query, I reduce the distance bettwen categories of UI and inputbox?
Hello:
I use JDeveloper 12.2.1.
I created AF:Query engine of research, using a ViewObject with UI classes.
AF:query shows the categories and the intputbox below them. (See the image)
How can I reduce the distance bettwen them?
I tried to change the properties of the AF:Query with the skin Editor, but I can't find the way.
Thanks in advance,
Jery
Thanks for your help, Timo.
With this information, I reduced the space, using the following steps:
1. place a styleClass on af:query
2. set DISABLE_CONTENT_COMPRESSION on web.xml file
3. search HTML element to hide with FireBug (Firefox)
4. create a CSS to hide the element HTML (image in this case)
The space is then less:
Jery
-
reading inputbox value application in J dev 11R2 JSF userinterface
There is an article (no base show all objects) in our JSF page and we want to read its value.
It gives a because null pointer exception that the element value not read of bean support.
our code as follows.
< af:commandButton text = "Cevapla."
Binding = "#{backingBeanScope.backing_app_yeniEvrak.commandButton24} '"
ID = "commandButton24".
action = "#{backingBeanScope.backing_app_yeniEvrak.Cevapla} '"
immediate = "true" / >
public String cevapla() {}
Add the code in the event here...
Yil string = (String) getInputText15 () .getValue ();
String evrakNumara = (String) getInputText16 () .getValue ();
int evrakLength = evrakNumara.length ();
Thanks for your help.The inputText has immediate = "true" as well? I think you have to do all the components accessible by buttons of immediate order immediate as well.
I'm not too sure that you must link a component (using the 'binding' attribute) to a support for this bean. Why not just a 'value' of the inputText a bean managed value? And do really anything other than property 'action' of the control button, bind what you showed.
-
Record data and report to the subfolder
Hello
I spend a day trying to solve this 'stupid' thing, but now I raise my white flag.
Hope someone could show me the way.
In my script, I want to organize so as to have the output result:
TOC files in the folder "testdata".
PDF + xls in the folder "testdata document «--------»»
I am able to create the testdata folder, but no idea how to create the subfolder.
The testdata folder must be a variable because it changes per event.
I've highlighted the error in my script.
Dim myfold
myfold = inputbox ("Nome della prova insert", "diadem", DataSetName)
Call foldercreate (DataReadPath & myfold)
Call foldercreate (DataReadPath & myfold\'documents')REM ' save data developed
REM if (FileNameGet ("NAVIGATOR", "FileWrite', DataReadPath & DataSetName & myfold &". "& DataExtension) ="IDOk") then
REM Else ' dialogue has been cancelled
REM call MsgBoxDisp ("data economy has been cancelled")
REM End IfGood bye
Giovanni
Just put in the "/" between the Documents and the name of the file.
Paul
-
With the help of DataFileLoad within a use
Hello
When you import files of type *.7d7 using the existing use, some of the proparties are not loaded correctly. I tried to fix this by creating a new use. Given that I do not have access to the file format (and I don't really want to write the plugin from scratch) I tried to use the existing plugin and then clean the proparties loaded.
Is it possible to use DataFileLoad inside the use vbs file? I get an error saying "Variable is undefined: «DataFileLoad»»
Also, I tried to use the msgbox inside the use as a way easy to debug but is became a ' permission denied: "msgbox" "error."
Thanks for the help.
Hi Denis,.
It is possible in a use VBScript to open an object file with the path of the data file.
Set file = OpenFile (DataFilePath)
It is possible in a use VBScript to open a store object with the path of the data file and the name of the use to use.
Set store = OpenStore (DataFilePath, DataPluginName)
It is NOT possible to make the function calls or variable reads/writes that are part of the DIAdem VBScript host (i.e. what normally run you in the SCRIPT Panel), because a series of VBScript in a VBScript use separate host that is embedded in ICU who has none of these orders or added variables. Remember that VBScript DataPlugins can also be run on a computer that has LabVIEW on it.
VBScript MsgBox and InputBox controls are also NOT allowed in a VBScript use because they would hang the DataFinder when trying to index the files of data headlessly.
Brad Turpin
Tiara Product Support Engineer
National Instruments
-
Try to define multiple versions of a variable in the input area
I'm trying to Dim variables that have different numbers of iterations whenever I run a script. However, I don't think I can use a variable in a Dim statement. Is there another way to do this?
Which, in my opinion, I want to do is this:
Xsum n, Sun, xavg
XSUM = 0
xavg = 0
m = InputBox ("how many tracks should be on average?") "For example, m = 3
n = m - 1 ' convert number of passages zero-based; for example, n = 2
Dim x (n)
For i = 0 to n
x (i) = i
Next "for example, x (0) = 0, x (1) = 1, x (2) = 2"
For i = 0 to n
XSUM = XSUM + x (i)
Next "for example, the filled xsum = 3
xavg = xsum/m ' for example, xavg = 1
Hi sraykens,
ReDim x (n) should work. I always protected my variables as scalars and use ReDim to turn them into bays when necessary - it works better for several reasons.
Brad Turpin
Tiara Product Support Engineer
National Instruments
-
setting for the title of the report
Hello
I have a report with many pages and I need the same title on every page. To do this, I would use a parameter that could be defined by the user via a VBS inputbox and then re-used on each page.
I tried something with scalar parameters: B1, B2, B3... (see attached file) but I don't know how to change their values. Is it possible to do it this way? If not, you have another method?
Thanks in advance for your support
Jeremy
Hi Jermeny,
I would recommend that you write the answer typed the user to the Root.Description property.
Answer = InputBox ("enter text")
Data.Root.Properties.Add 'Description', response
Then, in your REPORT header textbox, you can use @Data.Root.Properties ("Description"). Value @.
Brad Turpin
Tiara Product Support Engineer
National Instruments
-
global variables for the XML plugin problem
Hello world
recently I started working on a dialog box SOUTH, where the user can load the *.xml files in DIAdem.So much my code for the button looks like this:
....
Call the FileNameGet ('ALL', 'FileRead","*.xml")
Call DataFileLoad (FileDlgName, "XML_Plugin", "Load")....
And I must say that it works very well! I am able to load all listed in the devices file. BUT when I tried a number of loading devices, I used a global variable, that I defined in the vbscript file that I load the SOUTH since, I've noticed that global variables, I've defined with GlobalDim are not defined in the vbs.:mansurprised of XML_Pluging:
Then I started to experiment and so far without success, no matter where I define global variables, in my plugin *.xml all not defined! The native commands even and DIAdem functrions does not work. If I run the script in tiara, it shows no errors, but when I use the plugin to open a file, then it gives an error. For example, MsgBox is not allowed.
I used the plugin example for *.xml, which was published on the Web site of NOR, and I made a few changes. But overall I have it has not corrupted and I kept the same structure:
Void ReadStore (File)
Dim XmlFile: xmlFile = File.Info.FullPath
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'open the file '.
OpenXMLFile xmlFileEnd Sub
Void OpenXMLFile (xmlFile)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Open MS - Xml Parser
'Create the ActiveX object for the Microsoft XML parser.
Dim XDoc: set xDoc = CreateObject ("MSXML2. DOMDocument.3.0")"Try to load the XML document
If xDoc.Load (xmlFile) = False Then
"Failed to load the document XML.
RaiseError ' unable to load XML document!
End Ifprotected originalLocale: originalLocale = Getlocalte
"SetLocale" en - us "."The XML document loaded successfully!
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''----------------------------------------------
"Read the header information.
'----------------------------------------------Here, I have read some values of the header and then I loop on all devices present in the file!
So basically I have two subroutines and that's all.
SetLocale originalLocale
End Sub
So what I am doing wrong? Why global variables and other functions do not work. Is it because there is xml code in the script this way or it's a version problem?
I use DIAdem 10.2. If I use global variables in other vbscripts, I use to draw curves for example I have no problem. Now I'm no *.xml code and no subroutines.
I'd appreciate any solution that will make my *.xml plugin to work.
Hi fscommand.
It is expected all behavior. Use XML, as all VBScript DataPlugins, runs in a separate VBScript host of the DIAdem VBScript host. DIAdem VBScript host adds all global variables green and Red controls global to host Microsoft VBScript standard. Use VBScript host has its own special abilities (file object, root object), but there is NO access to Globals green or red blanket orders in the reception of DIAdem VBScript. Your SUDialog runs in a third host VBScript, which is separated from the other two and the other two are not capabilities (command SUDialog callback functions), but the SUDialog VBScript host and VBScript tiara share all global variables green and Red orders overall.
Normally all blue VBScript commands are allowed in all 3 VBScripts hosts, but in the case of the DataPlugins MsgBox and InputBox functions were especially restrained because the dialogues could cause a lot of trouble with the DataFinder. In fact, they have been allowed to 9.1 tiara which was the latest version of tiara for the DataFinder appear.
So, why do you want to pass information between the XML use and tiara? If you want to use to share information with DIAdem, then you should just expose every piece of information as a new property in the data portal, which can read and use the code VBScript DIAdem. The path of the XML file is already available inside the use of XML. What other information in the call VBScript DIAdem do you need to share with the use?
Brad Turpin
Tiara Product Support Engineer
National Instruments -
failure of the loop c ++
I am creating a loop that takes notes entered via the box... the loop checks if the user enters a numeric value valid and displays a msg of error if an incorrect value is entered. The loop also displays the score of each player and a running total in a list box item.
My loop out initially and does not work well... I can't seem to find out why:
DimstrBowlingScores AsString
DimintBowlingScores AsInteger
DimintScoreTally AsInteger
DimstrInputMessage = "Enter the frame score for player: #
DimstrInputHeading = 'Note-framework '.
DimstrNormalMessage = "Enter the frame score for player: #
DimstrNonNumericmMessage = ' error - please enter a numeric value for the player on the team: #
DimstrNegativeMessage = ' error - please enter a positive number for player #
DimstrCanceled = «»
DimintMaxNumberOfEntries = 15
DimintPlayerNumber = 1
DimstrTotalScores AsString = "Total Score".
strBowlingScores = InputBox (strInputMessage & intPlayerNumber, strInputHeading, "")
' intBowlingScores = Convert.ToInt16 (strBowlingScores)
' intScoreTally = intBowlingScores
DoUntilintPlayerNumber< intmaxnumberofentries="" orstrcanceled="">
IfIsNumeric (strBowlingScores) then
intBowlingScores = Convert.ToInt32 (strBowlingScores)
intScoreTally = intBowlingScores
IfintBowlingScores > 0 Then
lstBowlerScores.Items.Add (strInputHeading & intBowlingScores.ToString & strTotalScores & intScoreTally.ToString)
intPlayerNumber += 1
intScoreTally += intBowlingScores
strInputMessage = strNormalMessage
On the other
strInputMessage = strNegativeMessage
EndIf
On the other
strInputMessage = strNonNumericmMessage
EndIf
IfintPlayerNumber<= intmaxnumberofentries="">=>
strBowlingScores = InputBox (strInputMessage & intPlayerNumber, strInputHeading, "")
EndIf
Loop
Your question is beyond the scope of this community.
I suggest you post to MSDN and/or Stackoverflow
It may be useful
-
Macro for printing spreadsheets
Hello
Is there any option (formula or macro) in Excel that allows you to print one sheet of another without opening it.
Example: If there are 5 sheets, can print us sheet-2 or 3 or 4 or 5 on worksheet 1 itself, individually (not print all sheets).
If so, please provide the same.
Thanks in advance
Hey! I had found the answer...
We can use the macro by giving the VBA code...
We have an option to print either the entire workbook by using the following VBA code
Void PrintAllSheets()
'
Dim M As Long, N As Long, Firstsht as long, Lastsht As Long, sheet As Object
'
Lastsht = Sheets.Count
M = 0: N = Lastsht
'
For each sheet in the sheets
If not Sheet.Visible then N = N - 1
If Sheet.Visible and Sheet.Type = xlWorksheet Then
If case (Sheet.UsedRange) = 0 Then
N = N - 1
End If
End If
Next
'
Firstsht = 1 to Lastsht
'
If Sheets (Firstsht). Visible = True Then
'
If not TypeName (Sheets (Firstsht)) = "Chart" then
If case (Sheets (Firstsht). UsedRange) <> 0 Then
M = M + 1
GoSub DoPrint
End If
Else ' otherwise it's a chart
M = M + 1
GoSub DoPrint
End If
'
End If
'
Next ' Firstsht
Exit Sub
DoPrint:
With Sheets (Firstsht). PageSetup
. CenterHeader = "& F! & one ".
. CenterFooter = "Page" & CStr (M) & "of" & N
. RightFooter = "?" & CStr (Year (Date))
. FitToPagesWide = 1
. FitToPagesTall = 1
Ends with
Associated with the Application
. EnableEvents = False
Sheets (Firstsht). PrintPreview '. Print
. EnableEvents = True
Ends with
Return
End Sub
Otherwise, we can create a macro that leads to give the name of the excel sheet, we need to print... the following vba code helps us create the macro
Void Button92_Click()
Dim Nom_feuille As String
Nom_feuille = Application.InputBox ("enter a sheet name")
Sheets (sheetName). PrintEnd Sub
How to use vba code is
ALT + F11--> Insert--> Module--> copy the code above and paste the same--> Alt + Q
In the Excel worksheet.
In developer--> tab insert controls on a form--> button-->
Click the button and it prompts to select the Macro, we created.
(In the absence of the Developer tab, file--> options Excel--> Popular--> Show Developer tab in the Ribbon.) (Check the same and the tab will be displayed)
Concerning
Janaki
-
help with quality report with the functions of Chapter 5 in visual basic 2010
Public
Class GradeReport Private Sub btnExit_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click me.close() End Sub Private Sub btnCalculate_Click (sender As System.Object, e As System.EventArgs) Handles btnCalculate.Click Dim NumScores As Integer Dim average As Single Dim name As String Dim input As String Dim Count As Integer Dim total As Single ' get the number of students
entry = InputBox)
"How many students results of tests that you want to" & _ "Average?", "enter a value") If Not Integer.TryParse (input, NumScores) then return end if ' store the starting total values and County. "
Total = 0
Count = 1
"The results of the tests. Do so until the County > NumScores
entry = InputBox)
_ "Enter the value of the test music" & Count.ToString, "Test points required')"
Total += Total (input)
Count += 1
Loop ' calculate and display the average. If
NumScores > 0 Then
Average = Total / NumScores
On the other
Average = 0.0
End If
1stGradeReport.text = Average.ToString
"Calculate and display the letter grade. If the average< 60="">
1stGradeReport.text =
« F »
Elself average< 70="">
1stGradeReport.text =
« D »
Elself average< 80="">
1stGradeReport.text =
« C »
Elself average< 90="">
1stGradeReport.text =
« B »
Elself average< 100="">
1stGradeReport.text =
"A" End If End Sub
Hello
Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the MSDN Developer audience. You can get support for Visual Basic 2010 in the following forum.
VB general forum:
http://social.msdn.Microsoft.com/forums/en-us/vbgeneral/threads
Concerning
-
How can I get the 8.3 file name short AND way?
We use some old DOS programs and need to use the old format back (filename.xxx). When the files are in the long trees, it is very difficult to find the names of files under Windows.
There was a response published in Google (http://answers.google.com/answers/threadview/id/522710.html) which works very well under XP, but when I use it in Windows 7, I get the long file name.
Does anyone know how to do this? The program can be changed? Here is the program of this flajason-ga posted, but it must be updated for Windows 7 (I only know how to program in Foxpro). Thank you, Alan
Topic: Re: how to get the 8.3 file name short AND path?
From: flajason-ga on May 27, 2005 10:45 PDTAfter my last comment, I read your details a little closer.
The last script I posted was to list out a whole directory in 8.3 format.
If you are looking for a friendly way of Clipboard to recover the 8.3
for individual files, that will be more to your liking.Same thing as before. Copy the below into Notepad and save it with a .vbs extension.
Except that this time, you can simply drag and drop a folder or file icon
on the .vbs file and it displays the short path in an input box.
where you can copy the value and use anything you want to.If you're industrious, you can also save the .vbs file in your
Folder "send to" (C:\Documents and Settings\ [yourname] \SendTo) to have
It is available in your context menu with a right click.Set fso = CreateObject ("Scripting.FileSystemObject")
' Is a file or a folder?
If fso. FolderExists (WScript.Arguments (0)) then
"It's a folder
Set objFolder = fso. GetFolder (WScript.Arguments (0))
Refund = InputBox ("this is your short path:", "SHORT PATH", objFolder.ShortPath)
End IfIf fso. FileExists (WScript.Arguments (0)) then
"It's a file
Set objFile = fso. GetFile (WScript.Arguments (0))
Refund = InputBox ("this is your short path:", "SHORT PATH", objFile.ShortPath)
End IfHello
Read the following article.
How Windows generates 8.3 names to long file names
http://support.Microsoft.com/kb/142982
Maybe you are looking for
-
Hello I need to reset the bios password for my Compaq Mini 110, sn = CNU9367Z6Y. Thanks in advance.
-
Using Labview 2009 and TestStand 4.1, I developed a test solution. Found that I get the intermittent error-17500 appear when running my movie file using the TestExec.exe (simple UI of TestStand), who abandons then stable. I then used the TestStand se
-
I have problems with Windows, it seems... I looked in the file that shows my program files and one of them says 'Windows' - I'm supposed to get my programs to automatically... Well well... my problem with my personal files early... I get a window tel
-
Office 97 is compatible with Windows Vista?
Office 97 will work properly with windows Vista
-
While researching a slow start upward, I ran this test pre start of ePSA series. There are only 98% before, I left. I did see a very brief flash of a message which says "'waiting for completion DST". After 2 hours, I stopped the test. Is there a