Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Adding Code To My Program Through The Completed Program.


Hello,

I have a program that calculates some numbers.

Here is how it works.

1 the user inputs 2 numbers. A High and a Low into two text boxes.
Then the user presses Calculate and it does a series of mathamatics.
Once that is complete it out puts 5 different numbers to a table sort of deal.

NOW what I want to do is let the user enter a 6th number to calculate and output onto that table.

So lets say this is my code for the calculation.


VB Code:
Private Sub cmdCalculate_Click()Text1.Text = (txtHigh.Text - txtLow.Text) * 0.738 + (txtLow.Text)Text2.Text = (txtHigh.Text - txtLow.Text) * 0.093 + (txtLow.Text)Text3.Text = (txtHigh.Text - txtLow.Text) * 0.865 + (txtLow.Text)Text4.Text = (txtHigh.Text - txtLow.Text) * 0.953 + (txtLow.Text)Text5.Text = (txtHigh.Text - txtLow.Text) * 0.876 + (txtLow.Text)End Sub


Now I have a textbox on my form to enter a new number to calculate. So lets say the user wants that number to be "0.459" He would enter 0.459 into the textbox "txtNewnum" and click the cmdAdd button.

Then the program would have to add a new line of code to the 5 lines mentioned above and it would look like this.

VB Code:
Text6.Text = (txtHigh.Text - txtLow.Text) * [b]0.459[/b] + (txtLow.Text)


Does anyone know how I could pull this off?

Thank you and have a great day!
Stilekid007




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Packing A Completed Program
I hate VB6 Package & Deployment wizard. Can some of you post me some links to other packaging wizards out there. Thanks alot. Comments about them would also be nice like free ware , shareware and ease of use.

Determining A VB6 Program Setup Is Completed
In my program's installation. I have an autorun menu which if someones clicks a button on that menu, it will call the program setup. Then, it will run an exe file after my main program has finished its setup. I need to make sure the exe file is executed after the setup is finished.

I used the the following codes to do so:

Private Sub Cmd_Click()

'Run MyProgramsetup.exe. Note: I rename setup.exe
'MyProgramsetup.exe for the searching of it in the running processes
'used later.
Shell App.Path & "MyProgramsetup.exe", vbNormalFocus
Sleep (1000)

MyProgramPath = App.Path & "MyProgramsetup.exe"

'Wait until myProgramsetup is finished using a function which will search
'through running processes
Do While SearchProcess(MyProgramPath) = True
Loop

'Using a function to search registry to ensure "MyProgram" is installed.
If RegKeyExists(HKEY_LOCAL_MACHINE, "SOFTWAREMicrosoftWindowsCurrentVersionApp PathsMyProgram.exe") Then

'Run the exe
Shell App.Path & "AnotherProgram.exe"
End If
Exit Sub
End sub

I tested the code and it worked perfectly in my machine. I burnt the program and the necessary files to a CD and tried to run the AutoRun Menu.
With the CD, i clicked on the button and it called out MyProgramSetup and once it's finished, the menu just hang there. I found out that the "while loop" was running infinitely and "AnotherProgram" was not run.

Any idea what's wrong?
Or, do you have any other better way to do what i need to?

Call Another Program And Obtain Status Code After Program Is Closed
Hi,

I have program A (visual basic exe with user interaction) and program B( visual basic exe with user interaction). At the present they are two independent programs.

Say for example program A performs 5 steps sequentially.
I would like program A to call prgram B after step 3 of 5.

After program B completes its own processing it should close and pass a status code (success or failure) to program A.

Based on the status code program A either continues with Step 4 and 5 or undoes step 1 to 3 and then closes.

(I hope I have not confused anyone with my general explanation).

My questions how would I go about doing this?
How can I call program B from program A and then accepts a status code from program B once it completes?

Thank you
Cosito7777

Changing Program Code From Program...???
Hi,

Is it possible to change the source code of my program using textboxes within the program itself?

I have made a pricing app for my company and want to know if I can change the prices (which are set within the code) by entering a new price into a textbox.

Thanks.

Adding A Vb Program To A Program?
i have a simulation program and would like to have a command button that would start another vb program. the other prog is so the user can take a test. can i link that command button to the other .exe program? how?

My Completed Code..
Hello. Ok im looking for someone to look over my code and tell me how i could improve on anything.

GUI, Winsock code, Error handling, HTML codes, smileys etc....

The chat client supports HTML code + smileys. It runs when the server is up and connected to port 420. So please can a few people look over my code. All help, comments and reviews are more than welcome.

Thanks in advance.

noobie......

Adding Help To Program?
hi
I want to add help window to my program.
Does microsoft visual studio have this option? because I heard that visual studio has something like this.
thanks.

Help On Adding In Help To Program
How do I add Help to my program, I have the menubar setup but I can't figure out how to add help to it.

Adding More Than One Project To Your Program
Hey all i am trying to add more than one project to my program. Although i can do this, i wish for each project to share the same resourses (modules, classes, user controls, etc..). Is this possible? I cant seem to get this:

Code:
Project1 (Project1)
-Forms
-pro1Frm (pro1Frm)
-Modules
-Blah1 (Blah1)
-Class Modules
-BlahClass1 (BlahClass1)
-User Controls
-BlahControl1 (BlahControl1)

Project2 (Project2)
-Forms
-pro2Frm (pro2Frm)
If i put a button on the pro1Frm to show pro2Frm it doesnt seem to do anything? Is this possible?

If its not possible, whats the easiest way to copy and paste the same modules, classes, user controls, etc into the second project without any errors that the file already exists?

Thanks for your time,
David

Adding To Existing Program
Hi

I am going to build an application that will grow in the future. I want to just be able to design a .dll to pass through to the main application with the new functionality required. How do I do this?

I know I must build a interface class. Do I build it in the executable or as a seperate dll? Once I have implemented this interface on another dll, how does the main program read it?

Thanking you in advance

Adding Program Into Trayicon
I hav developed vb program and i want it to add it into taskbar tray.
I want to display comment on moving cursor on my icon in tray.
How can I do so? plz anybody reply my with long description. Thank you.

Adding Byets To A Program?
How could I do that? thanks!
and how do I make a program start when the computer starts? ; )
please and thanks!

Adding To Existing Program
Hi

I am going to build an application that will grow in the future. I want to just be able to design a .dll to pass through to the main application with the new functionality required. How do I do this?

I know I must build a interface class. Do I build it in the executable or as a seperate dll? Once I have implemented this interface on another dll, how does the main program read it?

Thanking you in advance

Adding Bar Graphs To My Program
perhaps i am missing something, as this function would seem to be fairly popular imo. but i can't figure out how to add simple bar graphs to my program.

i have a set of percentages to deal with that should be easy to translate into a graph in a seperate form window.

thanks in advance for the help

Adding A Program To The Tray
How would I add a program to the tray? For example....just like MSN Messenger, AIM, and almost any other program. :P

Any help would be greatly appreciative. Thanks in advice - Nino.

Adding Program To Systray??
How do you add your program to the systray, so that it will keep running, even if the form is minimized.

I want to make a voice recognition program, that accepts voice commands, but even if it doesn't have focus.

Thanks all,

10kman

Adding Files To A Program...
NO I DONT WANT TO ADD A VIRUS! Just incase that what you where thinking. I want to add a few .exe's to my program. Have them kinda, compiled with it, but not seen unless in the prog. Cuz i want to compile all my system oriented programs into one, and allow it as a download of the "full package". So people dont have to download them 1 by 1. yes i know i can take the source and copy it in, and yes i know i can zip them all together. BUT i have a good GUI for the main screen, and all my small progs have good gui's that i dont wanna redo. So if there is a way to add fully compiled exe's to a project, please tell me... Thank you

Adding A Menu Bar To Another Program
How would I integrate a customized menu bar to some other program... lets say mIRC?

Adding Sounds To A Program
Does anyone know how to add simple sounds to a vb program? right now i am only looking for simple sounds like *.wav sounds i would especially want to play sounds like the defualt windows sounds. If you can help me out or point me in the right direction it would be appreciated.

thanks
doug

Adding A User To My Program?
Hi everyone. I have a program where you have to login to access it. I would like to know how to enable a person to register, and then be able to close the program without the program forgetting the new user. I'd like to add that user so he can login again when he re-opens the program. If possible, I'd like to stick to Standard EXE's and easy things like that. I don't want to have to deal with databases or the such.

Thanks.

Adding Program To Quicklaunch
How do I add my program to the quicklaunch bar?
I found code to do this on Windows 95, 98, but not on NT nor 2000? Please! Thx!

Adding A Child Mdi Form To A Program
ignore the title of thread, i changed question at the last minute, sorry for any problems this coursed.
How do you change size of mdi parent form to fit a mdi child form exactly without coding

Program Adding Linebreak After Saving
Hey...

I've got a weird issue with my program...

In my program, the user has to enter the location of a specific file on his system. The program needs the folder that this file is in, so it needs to know what folder it is...
To prevent the user from having to enter the location every time he starts the program, I want to let the program save the location (variable) into a .txt file, and when the program loads, load the value from the .txt file.

The code I'm using:

Code:
Public Sub AssignFilePath()

On Error GoTo ErrorHandler:
FF = FreeFile()
Open App.Path & "filepath.txt" For Input As #FF
FilePath = Input(LOF(FF), #FF)

ErrorHandler:
If FF > 0 Then Close #FF

If FilePath = "" Then
FilePath = "C:"
MsgBox "No filepath selected! Default filepath selected..."
End If

End Sub

'------------------

Public Sub SaveFilePath()

FF = FreeFile()
Open App.Path & "filepath.txt" For Output As #FF
Print #FF, FilePath
Close #FF

End Sub
As far as I know there are no errors here?


Well, the problem is this:

After the variable "FilePath" has been given it's value, "SaveFilePath" is called and the value of "FilePath" is saved into "filepath.txt".
So, if "FilePath" is for example "C:Program FilesSomething", then "filepath.txt" contains "C:Program FilesSomething".

At least that's what it SHOULD contain...

After saving, I noticed that the program adds a linebreak (enter) after the value for some reason...
So instead of "C:Program FilesSomething", "filepath.txt" now contains
"C:Program FilesSomething
"

And when this value is loaded into variable "FilePath" again, the program cannot use it... (Because then, the program will use this for example:
"C:Program FilesSomething
File.jpg"

which results in an error...


So why is it adding a linebreak (enter) after the variable when saving? :S

Adding Documents Under Program Group
I want to add few documents along with the executable in the program group. When user goes to Start > Program files > Application, both the executable & document should be listed. How can this be done?

Adding Delay Time In Program
How can i add a delay time to my program before it is executed. For example, i click on the command button and the program waits for a few seconds before it begins. Is it possible?

Adding My Program In Control Panel
Once I have finished my program. How would I add it to the control panel on a win2000 system. May an registry setting? Thanks

Adding A Counter To An Easy Program
Hello everyone, Diesel here. I have one more question that I hope someone can help. The program that I have created, tells you in a messagebox if the letter r or n is the a word when you type it in an inputbox. But, my problem is that I have to make it count the amount of r's and n's in the word. The program is really easy, but it's a problem I just can't get around.
Here's the code...
Dim word As String, num1 As Integer, num2 As Integer

Private Sub cmdexit_Click()
End
End Sub

Private Sub CmdStart_Click()
num1 = 0
num2 = 0
Call jinput(word, num1, num2)
Call jprocess(word, num1, num2)
Call joutput(word, num1, num2)
End Sub
Private Sub jinput(word As String, num1 As Integer, num2 As Integer)
word = UCase(InputBox("Enter a word"))
End Sub
Private Sub jprocess(word As String, num1 As Integer, num2 As Integer)
num1 = InStr(word, "N")
num2 = InStr(word, "R")
End Sub
Private Sub joutput(word As String, num1 As Integer, num2 As Integer)
If num1 > 0 Then
MsgBox "This word contains the letter N"
Else
MsgBox "Sorry no N, try again"
End If
If num2 > 0 Then
MsgBox "This word contains the letter R"
Else
MsgBox "Sorry no R, try again"
End If
If num1 = 0 Then
num1 = 1000
End If
If num2 = 0 Then
num2 = 1000
End If
If num1 > num2 Then
MsgBox "The letter R comes first"
End If
If num2 > num1 Then
MsgBox "The letter N comes first"
End If
End Sub
Thanx
diesel

What Are My Options For Adding A Day Calender To My Program
What are my options for adding a Day Calender to my program.
I would like to add a component to my application in which the user
can add records to a day's event. Similar to what is found in
an agenda or Outlook's Calendar area.
I have found the month view for VB6, but not day view.

Any ideas?

Kid41CA

Adding A User To My Program And Saving It
hello. i have this code that check for name and password and if both are typed in correctly then it will hide the main form and show the user form.

Private Sub cmdSignIn_Click()
Dim Name
Dim Password
Name = InputBox(" Please enter the name.... ")
Password = InputBox(" Please enter the password below to continue.... ")
Dim chk As Boolean
chk = True
Dim Clear
Clear = Name = "" And Password = "" = chk
Dim i


If Name = "name1" And Password = "pass1" Then
lblDenied.Caption = ""
tmrBlink.Enabled = False
tmrBlink2.Enabled = False
lblMessage.ForeColor = vbBlue
lblMessage.FontSize = 9
lblMessage.Caption = "Welcome " & Name
WAIT (1000)
frmSignIn.Hide
frmUser1.Show
ElseIf Name = "name2" And Password = "pass2" Then
lblDenied.Caption = ""
tmrBlink.Enabled = False
tmrBlink2.Enabled = False
lblMessage.ForeColor = vbBlue
lblMessage.FontSize = 9
lblMessage.Caption = "Welcome " & Name
WAIT (1000)
frmSignIn.Hide
frmUser2.Show
ElseIf Name = "name3" And Password = "pass3" Then
lblDenied.Caption = ""
tmrBlink.Enabled = False
tmrBlink2.Enabled = False
lblMessage.ForeColor = vbBlue
lblMessage.FontSize = 9
lblMessage.Caption = "Welcome " & Name
WAIT (1000)
frmSignIn.Hide
frmUser3.Show
ElseIf Name = "name4" And Password = "pass4" Then
lblDenied.Caption = ""
tmrBlink.Enabled = False
tmrBlink2.Enabled = False
lblMessage.ForeColor = vbBlue
lblMessage.FontSize = 9
lblMessage.Caption = "Welcome " & Name
WAIT (1000)
frmSignIn.Hide
frmUser4.Show
ElseIf Clear = True Then
tmrBlink.Enabled = True
MsgBox ("Please enter Name and Password to continue..."), vbInformation, "Login faliure..."
lblMessage.ForeColor = vbRed
lblMessage.FontSize = 9
lblMessage.Caption = "Please type in your name and password and try again...."
Else
tmrBlink.Enabled = True
MsgBox ("Wrong Name or Password..."), vbInformation, "Login faliure..."
lblMessage.ForeColor = vbRed
lblMessage.FontSize = 9
lblMessage.Caption = "Check you name and password and try again...."
End If
End Sub


how do i make it so that a person will be able to add a new user and when a user will be created it will be saved in my application and it will automaticly create a form (frmUser11) and add a code that i want it to have something like this

frmMain.addform (myform)

Program Crashes, When Adding Record.
I am building a program that will add entries to a database, the program works fine on my laptop which im using to develop it on but when i load it on a users system it crashes as you add an entry.

I have attached a screenshot of the error report to this thread, seems to be related to fm20.dll but im not sure why it happening.

It can read from the database as the program displays info pulled from the db.

I suppose my question is: how do i fix this and what steps should i take on other users system to avoid this problem? if you need any more info let me know and i will post it up.

Kind Regards

PsYiOn

Adding Filles To Install Program
Hey there all, Just wondering if any of yo uknew the line of code I could use in INNO Setup to place a file in the app directory during install, its a word doc so the program doesnt know to put it in

THanks guys
xxx

RESOLVED:Adding To An Existing Program
Hi
I have an application to build. I know in time this app is going to grow. My question is how do I design this application so that once it is being used and new functionality needs to be introduced to it, that I can just create that new code in a dll and pass that to the existing app for it to use?

What I am trying to avoid is sending out a new install set of the whole program.

Thanking you in advance
PORRASTAR

Thanks a lot Stephen!!

Adding Expiration Date On My Program
Hi,
can someone tell me a way to put an expiration date on my program, kind of like being an evaluation version or a trialware. Pls tell me as many ways as possible, so i can compare.


many thanx~!~!

Adding Window To My Program?? Screenshot..look At This
ok...i have this program that takes AIM windows and makes them tabable...like this...here is ssmaking ss brb)


ok..see how it takes the normal old AIM IM window and puts it in the program and makes it tab able? i want to be able to do this? anyone know how ^_^.

Adding An 'Uninstall' Program Item Through PDW
Ok. I'm creating my setup program through PDW and I'm wondering how to create an item in the program group for uninstalling my application.

I know PDW packages the st6unst.exe file but how do I reference my installation log file?

Thanks...

Adding ShortCuts And Program Group
How Can I Add a shortcut and Program Group from VB?
In :
Windows 95
Windows 98
Windows 2000
NT WorkStation
NT Server

In English and Spanish

Thanks

Rafael

------------------

Adding ShortCuts And Program Group
How Can I Add a shortcut and Program Group from VB?
In :
Windows 95
Windows 98
Windows 2000
NT WorkStation
NT Server

In English and Spanish

Thanks

Rafael

------------------

Adding A Delete Icon Into A Program
I want to add a delete icon to my program.Does anyone know of a website where I can download?

Help With Text File Search Code - COMPLETED
i am working on a security keypad program that reads from a text file to validate a password, however if the password isn't at the top of the list it doesn't validate. how would i get it to search the entire text file for a password?

Adding A Toolbar Button To An External Program
I want to know if it's possible to add a toolbar button to an external program.

To be more exact I want to add a toolbar button to microsoft access that will load my program when clicked.

Any help on this will be appreciated.
Thanks in advance!

Adding A User List To Chat Program
Searched quite abit for some info that is pertinent to adding a User list to a chat program and coming up pretty much empty. Found a chat program that uses a list box and lists users, but wasn't able to figure out how he was doin what he was doin.

What I want to do is add a list box and then when people connect have it display their name in the list box and when they disconn remove that name from list.

So far I have the list box made and can get the user name to appear on the local machine, but not the remote machine.

What I need is a starting point to learn this, I am hoping that someone more familiar with the search terms and such used might be able to do a better search than I can and help me with that starting point. I have been following along with tutorials but can't find one that deals with this. Hope Im not asking to much, thanks for any replies.

Bry

Adding New Records That Arent Seen Until Program Restart
I am writing records to an access database. The code works fine the database updates with the new record. BUT after adding a record when I try to view the record it does not appear. If I restart my program the new record will be there, but not if i add it then go to a different screen that displays that record!
This is quite urgent so any help would be greatly appreciated

Adding My Program To The Right Click Menu Of Every File
i want to add my program to the right click menu of every file, kinda like winzip does...

Adding Internet Shortcut To Program Group
Hi,
I am using the Setup Wizard that is included with VB5 to install my program. How can I make it so that when it places icons in My program's program group, it places an icon that links to my web site in the group too? Is it possible by editing setup.lst?

Thanks!!!

Adding A VB Program To The List Of Startup Processes In Win Xp
Hiya guys,

I was hoping some one could give me pointers on how to get a VB program to add itself to the list of processes in Win xp that is started when Win boots up?

Thanx guys
JP

VB Program Adding Multiple Records To Database
Hi All,

I have a VB program that updates a table in Access with some results. However I am finding that when it runs the update it is adding multiple entries.

I think that it is looping the code or something, but I can't tell where it is occuring.

Here is the code I am using:

Public Sub Update_Records()
' This part updates the access database with the verified part number
' and serial number and date for our own records.

Dim var_Part1 As String
Dim var_Part2 As String
Dim var_Serial1 As String
Dim var_Serial2 As String
Dim var_Verified As String
Dim var_Master As String
Dim db_verify As Database

var_Part1 = frmMain.txtPart1
var_Part2 = frmMain.txtPart2
var_Serial1 = frmMain.txtSerial1
var_Serial2 = frmMain.txtSerial2
var_Master = frmMain.txtMaster
'var_Verified = varResult1

Const DB_VERIFYPARTS = "P:Verify_Parts.mdb"
Set db_verify = DBEngine.OpenDatabase(DB_VERIFYPARTS)
Dim qry_update As QueryDef
'update the Verification dB with the date and supplier serial number

Set qry_update = db_verify.QueryDefs("qry_SaveVerified")
    qry_update.Parameters("PartNum") = var_Part1
    qry_update.Parameters("SerialNum") = var_Serial1
    qry_update.Parameters("Verif") = "Y"
    qry_update.Parameters("Dat") = Date
    qry_update.Execute
Set qry_update = Nothing

'Clear variable values
var_Part1 = ""
var_Part2 = ""
var_Serial1 = ""
var_Serial2 = ""
var_Master = ""

Call Verified_Yes
End Sub

mot98

"Is it friday yet?"


Adding A New User For A Password Program Without Forgetting The Others
I need to know how to have a function in my password program that I'm writing that will enable the user to add a new username and password if they know a certain password that I would set in my program. I want to have it so that they can click on a certain button that will bring up another dialog box that will ask for the password required to add a new user. There will also be another one to change the adding password if you know another password that I would only know. I need it to add a new user somehow so that you could use different usernames and passwords rather than the same one all the time. I don't know if I would have to use .dll or another type of VB program rather than just Standard .exe. That's the only kind I've actually pragrammed with before, so I'm not sure what to do. Please help and give examples I could use a lot of help!

Now, don't get me wrong, 'cause baseball's a great sport.
It teaches little children simple eye-hand coordination with little effort or exhaustion.

 -byufan

Adding Or Deleting Scrollbars While Program Is Running
Why can't I change the scrollbars of my text box while it is running?
If I have something like this in command1_click procedure "txtText.ScrollBars = 2", I get an error...

Adding ODBC Item At Program Load
Im a newbie here and im trying to find a way of creating an ODBC item by coding it. Im aware that the package deployment wizard does not automatically create and setup the required ODBC. I'd greaty appreciate any help. Thanks.

Copyright © 2005-08 www.BigResource.com, All rights reserved