Programing Code For VB - Code For The Days In The GetDay Function

Jul 3, 2011

This is my first time writeing a program and i am stuck. i am just looking for were i should go next. i can't figure out how to write in code for the days in the getDay function.

Write a program that computes the cost of a long-distance call. The cost of the call is determined according to the following rate schedule:

a. Any call started between 7:00 A.M. and 9:00 P.M., Monday through Friday, is billed at a rate of $0.30 per minute.

b. Any call started before 7:00 A.M. or after 9:00 P.M., Monday through Friday, is billed at a rate of $0.15 per minute.

c. Any call started on a Saturday or Sunday is billed at a rate of $0.10 per minute.

The inputs will consist of (1) the day of the week, (2) the start/end time of the call, and (3) the length of the call in minutes. The output will be the cost of the call. Input will come from the user and outputs will be displayed via the console window.

Module program1

Sub Main()
Dim day As String
day = GetDay()

[CODE]...

View 5 Replies


ADVERTISEMENT

Code To Setup Program To Expire After 30 Days

Jan 12, 2011

Is there code in visual basic 2008 where i can set my program to expire every 30 days ?

View 4 Replies

Code To Setup Your Program To Expire After 30 Days

Jun 5, 2011

Is there code in visual basic 2008 where i can set my program to expire every 30 days ?

View 8 Replies

Function For Getting The Difference In Days Between Two Days Is Giving?

Jun 27, 2011

The function for getting the difference in days between two days is giving me a wrong answer here.What could i be doing wrong??? DateDiff(DateInterval.Day, CDate("28/1/2011"), CDate("31/1/2011"))

View 1 Replies

Code To Load The Already Compiled Yahoo Files To Execute The Code Again, Without Having To Recompile The Code?

Dec 8, 2011

I have some code to execute code at runtime...

Here is the main

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
If TextBox1.Text.Trim <> "" Then
If TextBox2.Text.Trim <> "" Then

[code]....

When the button is pressed, it all works and the following files are created: yahoo.dll and yahoo.pdb My question is this: What is the code to load the already compiled yahoo files to execute the code again, without having to recompile the code?

View 1 Replies

Execute VB Code Behind Function Before Javascript Function?

Jun 14, 2012

Possible Duplicate:

calling ASP function from javascript
okay running this code :
<script type="text/javascript">

[code].....

View 2 Replies

Code For Next Function In VB?

Sep 3, 2010

I have an access database merged with my form.

I created a menu with next back ect,

with code for the next menu button to go to next, back, first, last record in attached database

View 5 Replies

Using A C++ Function In A .NET Code?

Nov 4, 2009

I found a function in C++ that I would like to call in VB.NET, but I don't know how to do it. I was reading some forums and they said you had to create some sort of wrapper or something like that :8-0:This is the function I need to use, and it comes from microsoft's page here. Basically, it returns all the loaded DLLs for a given process ID.

I wanted to to something like this:Code:Dim myProcessId As String = '1234'Dim myModules As New List(Of String)myModules = getProcessModules(myProcessId)' ^ I know right now the C++ function doesn't return anything (it only prints) but I don't know C++ so I'll have to try to change that later.

Code:#include <windows.h>#include <tchar.h>#include <stdio.h>#include <psapi.h>
void PrintModules(DWORD processID){ HMODULE hMods[1024]; HANDLE hProcess; DWORD cbNeeded; unsigned int i;
//Get a list of all the modules in this process. hProcess = OpenProcess( PROCESS_QUERY_INFORMATION

[code]....

don't use ACCESS, EXCEL, or a TEXT FILE as a database. If you want your program to use a "local database", without any of the hassle of setting up a MS SQL or MySQL server, just click this link: >>> SQLite <<< Seriously.

View 4 Replies

VS 2010 Convert VB6 Code To VB2010 Code From "The Most Amazing VB6 Code Ever" Thread?

Jul 19, 2011

This code was posted in Chit Chat and everyone is saying how great it is. I just have Visual Studio 2010 and no familiarity with VB6 so I thought it would be good to convert the code to Visual Basic 2010.

[Code]...

View 39 Replies

Call A Jq Function From Code Behind?

Sep 30, 2010

I need to call this from the code behind if there is a certain value read in from a query string variable ie

x as string = request.querysting("Var")
if x = 'Hide" then
function guestHide()

[Code].....

View 1 Replies

Create A New Sub Or Function In Code?

Dec 27, 2010

I remember that C# editor has a powerful option that when we are developing in code and type a new method (operation) name for a class, we can create its body by clicking on ALT+Shift+F10 and immediately, it will be created for it's own class.

what about in VB.NET 2008 editor?

View 1 Replies

VS 2010 Code Does Not Function?

Oct 20, 2010

i use this code many times on all my applications.but now i'm on windows 7 and changed the framework to 3.5 and the code does not do what it supose to do.If File.Exists(Application.StartupPath & "downloaded" & ListViewEx1.SelectedItems.Item(0).Text & "ar.exe") Then

[Code]...

View 3 Replies

.net - Function Does Not Return A Value On All Code Paths?

Mar 19, 2011

Private Function ViewPropertyCast(ByVal type As String) As String

Select Case type
Case "smallint"
Return "Short"
Case "nvarchar"
Return "String"

[Code]...

View 3 Replies

Asp.net - Perform Code-behind Function / Sub From Javascript

Jun 11, 2012

In my project, there are 3 user controls; BasicContact, BasicDetail and ActionTime. They are in EditOrder.aspx page. There is "ReportDate" property (Date type) in BasicContact, RadioButtonList "rdl_Priority" (with integer value from "prio_id" field) in BasicDetail and "CheckDate" property in ActionTime. The ReportDate value is derived from txt_ReportDate and txt_ReportTime and CheckDate value is derived from txt_CheckDate and txt_CheckTime.

[Code]...

View 1 Replies

ASP.Net VB Call JavaScript Function From Code Behind?

Feb 10, 2012

I have a function that is responsible for populating an SSRS report. The user presses a button and I go out and check to see if there is data. If no data, I provide a NO DATA message. If there is data I call the SSRS report which I would like to open in a new window.

<script type="text/javascript">
function openWindow(url) {
document.forms[0].target = "_blank";
}
</script>

View 4 Replies

C# - Create Mustoveride Function With Code In It?

May 27, 2011

I have a MustInherit class with some MustOveride Methods in it. When i inherit form that class, I automatically get the MustOveride Methods or properties. My question is, I want to be able, to inherit from a class, get my MustOveride functions and methods, but then with some code already in it. I've once seen a .net class that did it, when I inherited from that class, I got the methods, with some comments in it.

View 4 Replies

Call A Function In Code Behind File In ASP.NET?

Mar 26, 2009

I have ShowValue working. Now, on the last line I need to call the function newFunction to repopulate the dropdownlist object on the onClick event.

I am getting errors when I click the dropdownlist down arrow.

How do I get the two to hand shake with each other?

My code:

Public Sub ShowValue(ByVal sender As Object, ByVal e As System.EventArgs)
lblupdatePanel.Text = DropDownList1.SelectedValue.ToString
Dim LocationDescription2 As DropDownList =

[Code].....

View 3 Replies

Call Cript Function From Code Behind?

Mar 15, 2012

I wants to ask about how to call the javascript function/method in .aspx file from code behind(or server code)?[code]...

View 3 Replies

Call VBA Function From VSTO Code?

Aug 3, 2009

I need to call a VBA Function (accepting parameters and returning values) from a VSTO Add In Code base. The macro code base in the .xlsm file is as follows[code]...

View 7 Replies

Code Is Missing But Program Still Does Its Function

May 21, 2012

I have a problem with my vb.net program. Some parts of the code dissapeard but i still can run the program normaly. Even if i add a new button it doesnt appear.I have a button that uploads some files to mysql database but then i double click that button a new sub appears with nothing in it..

View 5 Replies

Code Needed For On Click Function

Oct 12, 2009

I have just downloaded Visual Basic Express 2008, I have previously only ever used access and I have a rather stupid and basic question to ask! I have a button and am trying to enter the very simple code so that when it is clicked it opens Form2, I am unsure as to how this is written as the "expression" I would have used in access obviously doesnt work.

View 2 Replies

Convert Code C# To VB - Function References?

Mar 31, 2009

I have some C# code I'm trying to convert to VB.NET. There are some external dependencies I'm referencing in each project. The C# line is

TWriteFileCommand writeFile = (TWriteFileCommand)CommunicationLink.CreateCommand(TOPKernel.TCommand.CommandType.WriteFile);

I don't really understand what the TWriteFileCommand in parathesis after the equal sign is for in that statement. When I try to do it in VB.NET, I keep getting errors because I can't get a reference to the CreateCommand function. The closest I've gotten is this:

Dim MyAppBase As OPSupport.App.AppBase
Dim writeFile As TWriteFileCommand
writeFile = MyAppBase.CommunicationLink.CreateCommand(TOPKernel.TCommand.CommandType.WriteFile)

However, I have a green underline after the equal sign @ MyAppBase that flags an error "Variable MyAppBase is used before it has been assigned a value. A null reference exception could result at runtime."What am I missing? Why in the C# code is the instance fine and what do I need to get the equivalent instance in VB.NET?

View 7 Replies

Convert Code To Class Function?

Mar 6, 2010

I am new to vb.net and would like to be able to convert the following code to it's own function - either inside the current module or better yet in a seperate class.This code currently runs in the KEYPRESS event and ensures only numbers, decimal point, 2 decimals etc. are entered and not letters. Works exactly how I want it but would now like it in a function.I need this code in numerous text box controls but I would rather just call it somehow with a function.

View 3 Replies

Function Can't Return A Value On All Code Paths

Oct 11, 2009

Function can't return a value on all code paths.[cde]...

View 2 Replies

Function Does Not Return Value On All Code Paths

Nov 20, 2011

I am getting the warning that the function doesn't return a value on all code paths.

Function newgradelevel(ByVal valscore As Integer, ByVal strgradelevel As String) As String
If valscore >= 70 Then
If strgradelevel = "Freshman" Then
newgradelevel = "Sophomore"
ElseIf strgradelevel = "Sophomore" Then
[Code] .....

View 1 Replies

Function To Retrieve Line Of Code?

Jan 16, 2010

I am looking for a function like this:Function(Line x) must return the line x as a string (where Line x is a line of code from Form1 I specify)

Example:

Function(Line 10) returns the code (instructions) from line 10 as a string
If Line 10 from Form1 is: "if a=b+c then...."
Function(Line 10) returns "if a=b+c then...."

View 3 Replies

Have A Static Generic Function In .net 2.0 VB Code?

Sep 2, 2009

I must be doing something wrong here (because really, what are the chances of me tripping over another bug in the Vb.net compiler?)I have a static generic function in .net 2.0 Vb code, I thought it was time to "upgrade" it to be an extension method, but the compiler complains with Extension method 'AddIfUnqiue' has type constraints that can never be satisfied.

Here's a trivial example that displays the same problem. The old static version (which works fine) followed by the extension method

Public Class MyStaticClass
Public Shared Sub AddIfUnqiue(Of T, L As {List(Of T)})(ByVal this As L, ByVal item As T)
If this.IndexOf(item) < 0 Then

[code].....

View 1 Replies

Interfaces - Adding Code To A Sub Or Function

Jan 14, 2010

In using the IDisposable Interface, the two subroutines are displayed in my code from Microsoft when coded. How do I do the same with an Interface that I write? Is it possible or is this a feature that only Microsoft can do? I am using Visual Studio 2005!

View 7 Replies

Pause In Code Can't Use Sleep Function?

Jan 4, 2011

"'I'm having an issue sorting out why my code isnt working. When I "step into" it line by line i can get it all to work exactly how I want, however when I actually run the macro i get an subscript error 9. The code basicly sets a .CSV url to a variable "CurrentURL". The code then launches this url which opens a .csv window called table.csv. I want to copy 2 columns off this window and paste it to another document called "MPT_CAPM_v1", then close table.csv. Here is my code the red line is where I believe I'm running into my error.'This macro opens a URL, copies and pastes the price data into the sheet

[Code]...

I think the error may be caused by the fact it takes about 4-5 seconds to open table.csv in excel, and my line of code is trying to select a window that isnt currently open. After I get the error message, table.csv opens up. I've tried Loops & Sleep functions to try to input a delay, but regardless it seems that table.csv will not open until the end of said loop or delay.

View 6 Replies

Send Data To Function In Code Behind?

Jun 7, 2011

I have a modal/dialog with two buttons, "OK" and Cancel. When I hit "OK" I want to send these data to a function on the server. How can I accomplish this? Can anyone give me some information/example? I belive I would have to use "$.post" but again, how would I send it to a particular page's function?

UPDATED ... still cannot reach code behind function.
$('#dialog').dialog({
modal: true,

[code].....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved