VS 2008 WeekDay / Name Function
Mar 16, 2010
I have a question about the WeekDay and WeekDayName functions:
[Code]....
The parameter "FirstDayOfWeekValue" is supposed to represent "the first day of the week", but I don't understand how it's used. I mean, if the date is 16th March, then it's a Tuesday. That's true everywhere in the world and under any condition, isn't it? If that's so, what is the relevance of "FirstDayOfWeekValue", which apparently lets you change the weekday of a given date? And what is the "proper" value I should use, in order to get the correct result (ie. 16th March = Tue)?
View 8 Replies
ADVERTISEMENT
Nov 23, 2009
how to calculate a weekday of a given date?
View 8 Replies
May 29, 2009
My program is to read serial port based on the timer, so every ticks, it reads the value and write it to a textbox.The timer in the form is in the interval of millisecond. Therefore I make it 1, that means every 1ms, there is an event.The event I try is as simple as writing in a text box.
[code]...
the last code is meant to measure how many seconds will I get from d = 1 to 1000, it should return 1 second time difference. But instead of 1 second, it returns around 15 seconds.
View 4 Replies
Mar 3, 2012
How do I list every monday, as date, of a specific year?
I want to create this for every day of the week and put them into a datagridview. The most umportant is that I need to now how to get every weekday (e.g. monday) of the year.
View 8 Replies
May 16, 2010
I know I can import Microsoft.Visualbasic and just use the ones I used in vb6. But I don't want to ;)In vb6 DateDiff("d", dte1, dte2) would just give me the number of days between the 2 dates and it didn't matter which order I put the 2 dates, it would still return x days.In .Net i have Date.Compare(dte1, dte2) but I have to know which date is newer other wise I get a negative result because I subtracted a bigger from the smallerIs there no .NET way to just get the difference without having to subtract then multiply by -1 if its less than 0?ALSO,In vb6 I could use Weekday function to get what day of the week a date is and use it in the DateAdd function to find the first day of the week's date. Like so: dim firstday as date = DateAdd("d", (Weekday(today, vbWednesday) - 1) * -1, today) would like a .Net way to find the date of the first day of the week, giving that our week might not start on sunday or even monday. I need to pass a date and the weekstart day (wednesday) and have it return the date for the wednesday. Like this:dim firstday as date = GetFirstDay(Today, Firstday.Wednesday)so if the date i passed was "9/3/10" which is a friday, the function would return "9/1/10" which is the date my week started on.
View 2 Replies
Feb 28, 2011
I need to make a program in vb.net that asks for the user's birthday. The program should give the day of the week the person was born and their astrological star sign.
View 1 Replies
Aug 20, 2009
Hi. what is the difference of sleep function and pause function (using timer) between a loop.
View 12 Replies
Apr 27, 2009
What will happen when 3 function calls same function at a time? I have 3 Function, f1,f2,f3.. Those function after completing their task will call finish() function. What will happen if Finish is Called morethan once..
View 9 Replies
Oct 12, 2011
I want to make an numerical integration method with takes in an analytic function and integrate it over a specific interval. For the numerical integration procedure I want to use some procedures in nr.com. The problem is that these are programmed in C++ and they uses functors to pass a function to the integration method. How can I do this in VB 2010?
I want to initialize the function (i.e. set a=1,b=0 for function y(x)=a*x+b) and then pass the function to the integration method. Then when the integration method call the function it only calls the function with one parameter (i.e. x since a,b is already set)
What is the best way to do this in VB2010?I want to make a general integration method where I can pass any single valued function and integration limits.
I have just started using VB, and from what I have found so far it seems like the tools you have is
- to us a delegate for the function
- to use a lambda expression for the function
- send a pointer/adressOf
- to create a function class/structure and submit this to the function
As for now I am most inclined to create a function-class. But I am not really sure how.F.ex. I make different classes for each "uniqe function" I want to integrate, but how can I pass them to the integration function when I need to specify the argument type in the integration-function-call?This seems like a basic problem which applies to many Math operations, so I think it would be very useful to clarify this.
View 2 Replies
Apr 1, 2010
I'm trying to undersatnd the syntax of calling a funciton and it seem confusing when I'm using a web service in ASP.net. Maybe this question should be in an ASP forum, but it is a VB question. This simple web service allows you to type in your name and it response with an alert box with you name.
My question is, How can you call a function with 2 arguments when the function is only defined for one. I understand that the second argument is actually a method that handling the respons, but how can you interchange function arguments for methods and how do you know that there are methods for
Here's my call:
<script type="text/javascript">
function HelloWorld()
{
var yourName = $get('txtYourName').value;
[CODE]...
View 7 Replies
Dec 7, 2009
Im trying to make cipher the password before salting and hashing but when i try to call cipher it flags me on trying to change public to shared
class name : PassEn
Private _shiftCount As Integer
Public Property ShiftCount() As Integer
Get
[code]....
View 5 Replies
May 25, 2012
I am trying to convert a DLL function call which has the Callback function routine called within the DLL function call.The DLL function call signature is like this:
typedef void *HANDLE;
typedef HANDLE HACQDESC;
DECLARE_HANDLE (HWND);
[code]....
how to convert this DLL call to VB.NET and also how to create the callback function and send it as parameter to this function
call.
View 15 Replies
Aug 1, 2009
i wanted to ask how to make picturebox1 ,to which functions are already assigned, perform the same function as picturebox2 ,to which no functions are assigned.For example:I have already made picturebox1 and have assigned it alot of function like when play button is pressed then picturebox1.visible = true and when we press pause button picturebox1.visible = false. So now i decided to make a theme and have to remove the picturebox1 and want to allow the picturebox2 to havefunction of picturebox1.But when i disable the theme the function of picturebox1 should go back to picturebox1.
View 6 Replies
Oct 13, 2009
how to use the FV function in Visual Basic 2008? When using a button's click event procedure, am I supposed to put a formula in there? I get confused when other examples use different names in their procedures. All I know so far is that the code starts out like this:
Function FV( _
ByVal Rate As Double, _
ByVal NPer As Double, _
[Code].....
View 2 Replies
May 5, 2009
I've been coding in VBA and now I would like to start learning Visual Studio 2008. The problem is that it is very easy to find solutions to vba questions, but in my first Visual Studio application, I've hit a wall first thing and not so easy to find a solution. In VBA I used the all powerful dlookup function. It seems this function is not available in Visual Studio code.
I created a data source table Vendors.sdf in My Documents with 3 columns VendorID, VendorName, and VendshrtID. my goal is to enter the vendorID in Textbox1 and have the code return the VendorName in Label1 or if I enter the VendShrtID in textbox1 the code return the VendorName in Label1 as well. can someone tell me how to accomplish a dlookup equivalent in Visual Basic?
View 1 Replies
Mar 19, 2009
I've written C# class library and included it to my VB project. Everything works ok, unless I can't use my unsafe function... It's really important to have this unsafe function, through I wrote it to increase bitmap processing speed. So, how can I use it? When I try to type its name, IDE tells me, that it isn't member of that class.
View 4 Replies
Jun 17, 2011
I am getting records in my dataTable that have nullvalues and need to pass each of those through a function that gets the missing value. In this case my records are address's that are missing the "Latitude" and or "Longitude" Field
I need to be able to retrieve the values and place them in the missing column and row
Nulladdress
Public Function GetNullAddress() As Address()
Dim Addresss = (From row In dtsold.AsEnumerable() _
Where row.IsNull("Latitude") OrElse row.IsNull("Longitude") _
[Code]...
View 4 Replies
Nov 8, 2009
in my calculator script I'm trying to build I have a putton for pi, named Pi. The text on the button is pi. This is where the problem is. Up until now I've just been adding the value of the button to what I call the DisplayScreen (The textbox that outputs your answers), but Pi is not a number. And I want the value of the button to be Pi, not 3.14 whatever. This is what I have for the Pi
[Code]...
View 5 Replies
May 1, 2011
While reading about Visual Studio 2010 I`ve read that it has a possibility to begug only small pieces of code (eg. Functions, Subs). Is it possible to debug only one function in VS 2008?
I use Express Editions of VS2008, but maybe standard or Pro version has such functions?
View 5 Replies
Oct 3, 2010
I have a function as such:
Function THRoller(ByVal Swings As Integer) As Integer
Dim Hits, Misses As Integer 'variables for attack results
Do Until RollCount = 0 'RollCount taken from initiative winners AttacksBox
THRollVal = CInt(Int((6 * Rnd()) + 1))
If THRollVal >= THN Then
[Code]...
I'm sending the function a user determined value from another section. My problem is, it only seems to be generating one number, and listing each roll as a hit. How can I get a new roll(repeating values are fine) for each loop iteration? My apologies if the answer is obvious. I've only been programming for a week or so.
View 13 Replies
May 4, 2010
Looking for the function to convert 8.5% to .085
View 3 Replies
Aug 27, 2011
how to create a function.I've seen recently that creating functions is pretty easy and useful, rather than using each time plenty of code . However, now I want to create a function with two variables , BUT in some case I'd like to able to omit the second one..[code](that is by supplying only the 1st variable in the argument) I'd like it to round the value to its integer value .
View 2 Replies
Jun 19, 2009
I have this
vb.net
Function GetSerial() As Boolean
Dim myConnection As New SqlConnection
Dim myCommand As New SqlCommand
[code]....
When I put the code into the onbutton click it seems to work fine. But when i put it in the above fuction and start the function i get this error:
Error:System.IndexOutOfRangeException: Serials
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
[code]....
View 5 Replies
Dec 10, 2011
explain to me in plain English what this piece of code is doing? I can't work it out.
Randomize()Dim bingo1 As Integer = Int((49 * Rnd()) + 1)
View 4 Replies
Dec 13, 2009
I have a replace function in text files where it replaces all the vbTab with ';' betweens the columns. Sometimes it may be that some fields have more vbTabs and then there is lot of empty fields.How do I via a smart and simple way to replace all vbTab with ';'. That is, the field has more than one vbTab will they just be replaced by a
vb.net
Dim Fs As FileStream = New FileStream(my_filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)
[code].....
View 5 Replies
Aug 23, 2010
I'm attempting to create a function that will get the User Accounts from the registry. I then need to loop through those users and commit specific actions on each one.Here's my function:
VB .NET
ublic Function UserAccounts() As String
Dim userskey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWAREMicrosoftWindows
[code].....
View 1 Replies
May 29, 2010
I have the following code that will post variables to a file, and the file will return a value, and the vb application will read that. Here is the code;
[code]...
View 2 Replies
Jun 5, 2009
If I had this, for example:
vb.net
Public Function Check
Dim FCheck As Boolean
[code].....
View 2 Replies
Aug 14, 2010
VS 2008 [RESOLVED] Using the Left function
View 4 Replies
Apr 4, 2009
I am using this bit of
If (proxyListView.Items.Count > 0) Then
Dim ProxyArray As Array = Split(proxyListView.Items.Item(proxyListView.SelectedIndices), ":")
Dim ProxyServer As String = ProxyArray(0)
[code]....
to split a bunch of proxies in a listView, but i'm not sure the proper syntaxt to use at: proxyListView.SelectedIndices, i thought it was SelectedIndex but that doesn't seem to be an option in VS2008?
View 3 Replies