For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have a VBScript and want to copy a file. I want to make sure it finishes successfully.
If the destination-file is set to "read-only" there occures a Runtime Error '800A0046 - Permition denied'.
What I want: I dont want to get the Script-Host error message but instead my own. Therefore I need the error number ( the error code 800A0046 does not work ) so that I can use
IF (Err.Number > 0) THENIF (Err.Number = 32755) THEN
as I did it here to check if the user pressed cancel in a open-dialog box.
Since I'm very new to VBScript programming , I don't have any idea where I can look for a solution to problems like this one. So I hope to find help here. I googled a while and also searched in the MSDN but found nothing.
thank you for the fast answer. This helps me a lot
I tried it and it perfectly works. Thank you.
I took this part
CONST F_ATTR_RONLY = 1Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFS = FSO.GetFile("d:\test\o2\test.png")
IF oFS.Attributes AND F_ATTR_RONLY 'check if bit 1 is set - read only
FSO.CopyFile "d:\test\o1\test.png", "d:\test\o2\"ENDIF
i created an application that loops numbers from 2 textboxs ("Starting Sequence" and "Ending Sequence") and displays it into a datagridview, what i am looking for is a code that would pass the selected cell from the datagridview into the microsoft reports, or pass each row into 1 page of report (i.e. sequence 0001 will be in 1 microsoft report page upto the ending sequence to the last report page) can anyone help me?
In this program you will create a Windows Form application that will calculate and display the money made by a drive-in movie theater each night. The movie theater has two types of nights. A “Regular” night iswhere each person in a guest car has to buy a ticket, and each ticket costs $10. A “Car” night is a special promotion where there is one price per car of $15, no matter how many guests are in the car.
In addition to the cost of entry (either Regular or Car), the theater sells popcorn and candy but the price of the items depends on the type of night. On a Regular night popcorn costs $1.50 per box andon a special Car night popcorn costs $2.00 per box. On a Regular night candy cost $2.25 per candy box, whileon a special Car night candy cost $3.00 per box.
Onany night, the maximum number of cars allowed inis500and the maximum number of individual tickets is3,000; the theater can produce 4,500 bags of popcorn each night and has 4,000 candy items.
Once the total sales are calculated, the program will display a summary message with the type of night, the total number of cars, the total ticket sales, the total popcorn sales, the total candy sales, and the total sales amount.
This is what I have so far... Am I on the right track?
Dim intCars, intTickets, intPopcorn, intCandy AsIntegerPrivateSub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
EndSubPrivateSub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
Me.lblTotal.Text = NothingMe.txtNumCars.Focus()
EndSubPrivateSub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim strMessage AsStringDim dblNumCars, dblNumTickets, dblNumPopcorn, dblNumCandy AsDoubleDim dblTotalSales AsDoubleIf radRegular.Checked = TrueThenMe.lblTotal.Text = "Tonight was a REGULAR night."ElseIf radCar.Checked = TrueThenMe.lblTotal.Text = "Tonight was a CAR night."EndIfDouble.TryParse(Me.txtNumCars.Text, dblNumCars)
dblTotalSales = dblNumTickets + dblNumPopcorn + dblNumCandy
strMessage = "The total number of cars present was: " & dblNumCars.ToString() & _
"The total number of tickets sold was: " & dblNumTickets.ToString() & _
"The total popcorn sales were: " & dblNumPopcorn.ToString("N2") & _
"The total candy sales were: " & dblNumCandy.ToString("N2")
Me.lblTotal.Text = strMessage