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




Need An Answer Realy Fast :S


On an error.. i want the error to display in a MSGBox instead of a runtime error or something




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Use SPY++ To Do This? (need Fast Answer)
I want to use SPY++ as came with my MS VisualBasic 6.0
to find the name of a textbox in another running EXE

Cause i need to make a program that sends some text to a textbox in aonter running exe (that i did not make)

So how can i use Spy++ or another similar application to get the name of the textbox? (or editbox as SPY++ calls it)

Cause now it only gives me some info i cant make any use of..
It can give me the handle.. but that is not what i need (or want to use...yes i know that is a way to do it..but NO)

So how can i find the name of it (like: text1.text) ??


Seee picture !!

I Am In Desperate Need Of A Fast Answer Please Help Me
What does thi mean?
Run-time error '91':

Object variable or With block variable not set


This happens when I try to do anything with my ado data stuff this is the lines of code that matter

Adodc1.Recordset.Delete


Please Help me Thanks

Simple Question > Fast Answer
Hi,
Hi,
One easy question! How to check if some file exists on hard disk?
i.e. "C:File.txt"

Need Fast Answer - Data Structue For My App...
What type of data structure is best for a Daily calander?

Like the weekly calander in Microsoft Outlook....

Thanks in advanced!

SOS!! Simple Prob But I Need An Answer Fast
I need to write a screensaver prog(it doesnt have to be formatted like a screen saver..)for yearbook presentation to get on the commity..anyway Im not sure how id do that at all..i could i guess use a bunch of forms and put each of the pictures on each one and then have each for pop up in a random order..but i dont think so..that sounds more complicated then it should be anyway please respond fast

Easy Code, Fast Answer Plz {Sorting A ListBox}
Well to put it simply, I got a ListBox (list1) and I want the code to arrange its items in alphabetical order from top to bottom, so whenever I add an Item I can rearrange it so its in alphabetical order again...

I tried making it myself as after some testing I realised I can compare alphabetical order with mathematical terms, for example AB < AC , but I couldn't find the way to take each item in the list box and compare it to the others...

The Mousedown Isnt Very Fast If U Click Fast, Is There Another Way To Find If Pressed
im using the mousedown event to tell if the mouse button has been pressed

eg
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

use using mouseup to tell when the mouse button isnt being pressed


but the problem with this is that the mousedown event is slow to respond as if i click fast it doesnt register the button being pressed.

i was wondering if theres another simple way, which is fast, to use to tell is mouse buttons are pressed..

I Realy Need Help On This One
<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>Página normal. sem título</title>
</head>

<body bgcolor="#FFFFFF">

<form action="Call%20Calculo" method="POST">
<p><input type="text" size="20" name="Text1"> <input
type="text" size="20" name="Text2"> <input type="submit"
name="B1" value="Ok"> <script language="VBScript">
<!--
Sub Calculo()
Document.write "Merda"
end sub
-->
</p>
</script> </p>
</form>
</body>
</html>

I want to call de sub Calculo() when the Button1 is pressed,
what is wrong please help me.

Which Of Thes Dep's Do I Realy Need
Hi Guys,

I have an app that runs an access database.
I have made an installer setup using Inno & IStools, all seems fine!!

I have included several database files to help my app on other systems, there are:

dcom95.EXE
dcom98.exe
mdac_typ.exe
vbrun60sp5.exe
Jet40SP7_9xNT.exe

Now I have also a few Dll's & OCX files I have included But Im not sure If I realy need them all with having the above files too, So im hoping someone can advice me on what I need, when my app installs on to other systems at the moment it seems to be fine, there has only been 1 PC came up with an Runtime Error 429 so far.

The other dep's I am including at the moment are:

COMDLG32.OCX
MSMAPI32.OCX
MSCOMCT2.OCX
MSDATGRD.OCX
MSCOMCTL.OCX
MSADODC.OCX
RICHTX32.OCX
dao360.dll
MSBIND.DLL
OLEAUT32.DLL
scrrun.dll
ASYCFILT.DLL
COMCAT.DLL
msvbvm60.dll
OLEPRO32.DLL
msjtes40.dll
msrd2x40.dll
msrd3x40.dll
msrepl40.dll
MSSTDFMT.DLL
msvcrt.dll
mswdat10.dll
mswstr10.dll
VB5DB.DLL
VB6STKIT.DLL
vbajet32.dll
expsrv.dll
msado27.tlb
msjet40.dll
msjint40.dll
msjro.dll
msjter40.dll
STDOLE2.TLB
CDO.DLL
msado15.dll

Thanks again for any assistance
L

I Realy Need Help With This Form
ok hi im trying to make a form that has three parts part one a lable that says enter ip witch i have part too a text box that you can enter an ip in the format 000.000.000 but automatically separated by the dots and the third part a button that sends the message to that ip is this possible and if so can someone please help me i am relatively new to vb so i relay need help(sorry if it dont fit in this forum im kinda in a hurry)

Thanks

Realy Need Some Help Translate From C++
Hello folks,
How should this function look in visualbasic code?
Im been thinking about this for a while now but since i know nothing about C++ it's not so easy


VB Code:
void PrintMessage(char *Message, char Color){pPrint Print = (pPrint)0x6FAC6780; //function for adding message to chatwchar_t Buffer[0x130];  //buffer (0x130 was maximum from what i read somewhere)        //convert to WideChar (2 bytes per each character)MultiByteToWideChar(0, 1, Message, 100, Buffer, 100);Print (Buffer, Color);    //and print}


Big thanks,
Naitsabes

Anyone Realy Know What OLE Automation Is?
I don't understand what OLE automation is. Can anyone explain it for me?

What popular application uses OLE automation?

Should Be Realy Simple
how can I delete through code the first 7 characters in a text file

What Does This Realy Means
"Empty row cannot be inserted. Row must have at least one column value set."

the app. is about filtering a recordset,

Set Rst_Filter_Dt = DualFilterField(Rst_Batch_Dtl, "Batch_no", Text1(0).Text, "ProdPeriod", Text1(3).Text)

If Rst_Filter_Dt.RecordCount <> 0 Then Rst_Filter_Dt.MoveFirst

'the function
Public Function DualFilterField(RstTemp As ADODB.Recordset, _
strField As String, strFilter As String, _
strField1 As String, strFilter1 As String) As DODB.Recordset

RstTemp.Filter = strField & " = '" & strFilter & "' And " & _
strField1 & " = '" & strFilter1 & "'"
Set DualFilterField = RstTemp
End Function

'if only more details can be seen on the error messages things can be resolve quicker and precise.

10x
cyrus

Is BltFast Realy Slow?
guys i wanna draw trees on a forebuffer which i then copy into backbuffer. The drawin' area is like 800*600 and trees are like 80*60. But bltfast is * * * * slow drawin the trees on screen it reduces ma fps to half when the trees are more than 20. :O any1 got any idea???

A Realy Stupid Question
Hi, I'm a begginer with VB..... I donwloaded myodbc3.dll to use MySQL and I'm using this code that I found in this forum:

Set cnn = New ADODB.Connection
Set rs = New ADODB.Recordset

cnn.ConnectionString = "driver={MySQL};server=127.0.0.1;uid=root;pwd=;database=dbname;OPTION= 3;STMT=;"
cnn.Open
Set rs.activeconnection = cnn
rs.Open "select * from customers"
Form1.Text1 = rs!fieldname

My question is "How can I link to the myodbc3.dll "????? in oder words..... How can I use a .dll's file in a VB code?

Realy Weird Thing In Vb6
Ive goten a FILE counter and it works with the*.* thing
anyway it only counts the files in its own directory ,
so ive tryed to do a project but it doesent work properly , and after a few testings

ive found out that the file was in the directory i want to be ( the file as in the one that counts the files in its App.path )
and it gets to that directory by another program a (handler) i like to call , the handler basically copies the counter to a directory to count the files in it.

but when it gets copied i made it MSGBOX number of files and app.path

it sayd the number of files that the (handler ) was in , and the app.path was in another directory. this is very weird ... i dont know how to fix it not evin a possability.

i hope i made my self clear becous eim bad at explaining.
thats not the hole code .

Code:
Private Sub che()
Dim FileName As String, Bytes As Long, FileCount As Integer

FileName = Dir("*.*")
While Len(FileName)
FileCount = FileCount + 1
Bytes = Bytes + FileLen(FileName)
FileName = Dir()
Wend
MsgBox Str(FileCount) & " files on subdirectory using" & Str(Bytes) & " bytes. im in " & App.Path



End If
End Sub


the handler basically coppied it to another file , without running it untill it went to the folder


...

Realy Need Help!! Find String!
HI!!
Well i am cratinf webserver but i need to search a text in string to know what will be the next wepage tha will be displayed!! This is that string:
GET /index.htm HTTP/1.1
In this string my server have to find a websites url! my code is like:

VB Code:
Dim Search, Where    Search = "index.htm"    Where = InStr(Text1.Text, Search)    If Where Then   ' If found...        Text1.SelStart = Where - 1        Text1.SelLength = Len(Search)    Else        MsgBox "String not found."    End If

Well it finds the url but the problem is that
that URL can be default.htm or downloads.htm! So i need my server to search only for ".htm" and then add the rest url like downloads.htm! Can you please help me!!!???

Realy Weird Problem
I've made a program. then I made with the Application Setup Wizzard a install program. then I send it to someone. he started setup.exe and the program said that he couldn't find Cchat.exe. this would be necessary to extract ex_ files. I've searched for this Cchat.exe file, but it's a chat program!! isn't this weird? what can I do to make my program work at the other persons computer?

please help,

VisualPenguin

Packaging Error Realy Need Some Help
HI

i've encountered an error during the packaging of an application

at the last screen of the packing after give a name to the sript package a message box notify this error:

Unexpected error number 457 appears : key alreday linked to another item's collection

(be care i translated the error description french to english)

I'll enjoy you could give me some help

BEST REGARD


THOMAS

Realy Dumb Dir Question
got dir1.
now if i map a drive to my pc..
how can i make dir1 view the directory's on that maped drive (say M)

do i go dir1.path="m:" after mapping it?????

Realy Quick Question
ok, i want my program look for a certain string/keyword in one of my files on my computer:

<A HREF="ftp://

Thats the word i want it to look for, but if u havent all ready guessed it. It wont work. Reason for it is becuase of the darn quotes. I HAVE TO HAVE THE QUOTES IN THERE! ahmm, i just had to get that out of the way becuase i know what most of u are going to say . Now, how do i get around this prob?

This was the string i was going to use before this prob came along:

Code:
intAPOS = InStr(1, strFTPs, "<A HREF="ftp://")


Thanks (again)

People This Is Important (I Realy Need Help)
I'm having the presentaition of my program tomorow and i noticed that one thing is not finished. I just must finsh it until tomorow. You are my last chance.

I have 1 textbox

Problem:

I need to make program wich disalows user to copy information from textbox to clipboard.
(I need to make right mouse button and Ctrl+c
keys inactive on this textbox)

I tried to make something like:


Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 2 Then
KeyAscii = 0

End If

End Sub


But this just doesn't work


Any ideas apricieted

-thank you


------------------
-casparas

novice programer
casparas@metacrawler.com

A Realy Challenging Topic, Well I Think So!
I have need to be able to open a word document and view it within either VB, preferably VBA or Java and then print it in a pdf format. We have Acrobat and thus a postscript printing capability. I imaging you can get a VB control that facilitates opening and viewing word documents but I have no idea where you get one or how you use it, let alone how you go about printing it out.

Can this be done?
Cant be done in VB?
Is it exspensive?
How do you do it?

If anyone can help, thanks.

HELP: Realy Simple File Sending
Hi!!
I try to create a simple file seding programm. i try'd to send a 605 bytes small file but server recives only about 558 bytes!!! heres the code:

This is how i open the file!

Code:
Private Sub Command3_Click()
Open "C:Icon.gif" For Binary As #1
Do Until EOF(1)
Get #1, , strData
Text3.Text = Text3.Text & strData
Loop
Close #1
End Sub

then i send the string


Code:
Private Sub Command2_Click()
Winsock1.SendData Text3.Text
End Sub

and the server code when data arrivals, this will create a gif file from recived data string:


Code:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim ThisIsData As String
Winsock1.GetData ThisIsData
MsgBox ThisIsData
Open "c:File.gif" For Binary As #1
Put #1, , ThisIsData
Close #1
End Sub

byt this file is smaller and when i try to open it, it shows just: cannot display image, image is invalid or something like that!!
how can i send this file without losing data???
Thanx!!

Simple Question.. Realy Easy
ok i have this program im tryin to make and it loads a .txt into the text box and there are screen names in the text box and look like this( blah@aol.comblah@aol.comblah@aol.comblah@aol.com) what im tryin to do is to get the program to use the mid function or somethin of that sort to put them into a list like (blah@aol.com
blah@aol.com
blah@aol.com
blah@aol.com) how do i load the .txt into the text box first off? cause i can do a list box and get it to load and everything but the text box is trickin me?

Realy Simple Problem But I Can Work It Out ?
OK, so it looks likes its working fine but it slowly messis up when you move the screen around so im guessing its somthing small thats wrrong, also it COMPLEATLY messis up if you min the form or make it really small.

Any idears ?


you can see the source a lot better at

http://tsn.dk/p/?id=2077

Private Sub Admin_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize

        Static Old_Size As Integer

        If Me.Width > Old_Size Then

            Admin_Main_Sessions_Users_Com.Width = Int(Admin_Main_Sessions_Users_Com.Width + ((Me.Width - Old_Size) / 2))
            Admin_Main_Sessions_Sessions_Com_Tag.Location = New Drawing.Point(Int(Admin_Main_Sessions_Sessions_Com_Tag.Location.X + ((Me.Width - Old_Size) / 2)), Admin_Main_Sessions_Sessions_Com_Tag.Location.Y)
            Admin_Main_Sessions_Sessions_Com.Location = New Drawing.Point(Int(Admin_Main_Sessions_Sessions_Com.Location.X + ((Me.Width - Old_Size) / 2)), Admin_Main_Sessions_Sessions_Com.Location.Y)
            Admin_Main_Sessions_Sessions_Com.Width = Int(Admin_Main_Sessions_Sessions_Com.Width + ((Me.Width - Old_Size) / 2))
            Admin_Main_Sessions_Log_But.Location = New Drawing.Point(Int(Admin_Main_Sessions_Log_But.Location.X + (Me.Width - Old_Size)), Admin_Main_Sessions_Log_But.Location.Y)

        Else

            Admin_Main_Sessions_Users_Com.Width = Int(Admin_Main_Sessions_Users_Com.Width - ((Old_Size - Me.Width) / 2))
            Admin_Main_Sessions_Sessions_Com_Tag.Location = New Drawing.Point(Int(Admin_Main_Sessions_Sessions_Com_Tag.Location.X - ((Old_Size - Me.Width) / 2)), Admin_Main_Sessions_Sessions_Com_Tag.Location.Y)
            Admin_Main_Sessions_Sessions_Com.Location = New Drawing.Point(Int(Admin_Main_Sessions_Sessions_Com.Location.X - ((Old_Size - Me.Width) / 2)), Admin_Main_Sessions_Sessions_Com.Location.Y)
            Admin_Main_Sessions_Sessions_Com.Width = Int(Admin_Main_Sessions_Sessions_Com.Width - ((Old_Size - Me.Width) / 2))
            Admin_Main_Sessions_Log_But.Location = New Drawing.Point(Int(Admin_Main_Sessions_Log_But.Location.X - (Old_Size - Me.Width)), Admin_Main_Sessions_Log_But.Location.Y)

        End If

        Old_Size = Me.Width

end sub

Realy A Newbee Question . Need Help On A Simple Loop.
Hi i was wondering if anyone of you could help med with this.
I'm making a simple program with several labels, and i need to change the labelX.top command on all my labels.
This is easy in simple code, but there must be a way to automate it , so i dont have to wright it all inn.
Feks.
label1.top =
then the loop would change the value to label2.top= then label3.top = etc.

So that i dont have to wright
let label1.top =
let label2.top =
let label3.top =

Thanks Guy's

Gabrielli

Realy Need Help Please,, Treeview To 3 Listview, DBGrid1 To Slow
I use DBGrid1 to call from database

Table customer into DBGrid1
and when I klick on DBGrid1 I get info from Table workingTime into DBGrid2
From Table Rent into DBGrid3 and from table Whois into DBGrid4

In Table customer I use NR=autonumber
so when I klick on DBGrid1 I use NR to call same NR from Table workingTime, Rent and Whois

DBGrid1 is to slow, so I want to tray to use treeview and listview

But need help to now how I call customer into treeview and use NR from treeview to call the rest from NR in rest og the table
and pudit into listview..

HOW? HOW?

PLEASE som

Windows XP Button Howto (Read This Its Realy Cool)
Hey there,

i found a UserControl on the internet that make's Windows XP buttons in you VB Application!

Its cool though, but there is only 1 color available.

Download the Zip file, and place it somewhere on your computer. Make a new project, and add
the XP_Button usercontrol to your project.

Now, add the line below to your Form_Load section where Form1 is the form that contains the buttons:

Code:
InitialiseButtons Form1, True, True 'Must Call this to initialise the buttons


Place the code below somewhere apart in your project.

Code:
Public Sub InitialiseButtons(FrmForm As Form, Initialise As Boolean, Optional BytEnabled As Boolean)
On Local Error Resume Next
Dim Control As Object 'Define the variable control as an object
    For Each Control In FrmForm 'Check all controls on a form
        If TypeOf Control Is Command Then
            If Initialise = True Then
                Control.Initialize 'If its a XP command button then initialise it.
            Else
                If BytEnabled = True Then
                    Control.Enabled = True
                Else
                    Control.Enabled = False
                End If
            End If
        End If
    Next


Happy programming and have fun with this UserControl!

Greets,

DigitalHuman

Window Shaper--Fast, Very Fast
Many coders want to know how to shape a window around the image of a bitmap. That shape is a window region. But first, what is a region, really? Think of the bricks of a house. A region is really an array of rectangles that are stacked on top of each other. An individual rectangle can be as small as a 1x1 pixel. A complex region can contain hundreds or even thousands of such rectangles where a simple region contains only one rectangle.

The code behind the process is no secret and the logic is very simple.
Determine which color will be the "transparent" color of the bitmapCheck each pixel for that colorCreate a region portion that contains adjacent non-transparent pixelsAdd that region portion to a master regionDelete the region portionWhen all done, apply the master region to your window
To accomplish this task, generally 5 APIs are used:
GetPixel to determine the pixel colorCreateRectRgn to create the region portionCombineRgn to append the region to the master regionDeleteObject to destroy the region portion else memory leaksSetWindowRgn to apply the window shape
When the bitmap being used has most of its "transparent" colors close to each other, the above logic can produce fairly quick results. A major speed enhancement was to replace GetPixel with GetDIBits, so the pixels could be returned inside an array which can be traversed much faster than using GetPixel.

Now this is where most shapers stop when it comes to improvements. Unfortunately, we are left with the CreateRectRgn, CombineRgn & DeleteObject APIs which are applied to every portion of the region as it is being accumulated. Remember earlier we said there could be thousands of these portions. What if you don't need to call those APIs, how much faster would the routine return a region for your window? The difference can be noticed by the naked eye!

The next major speed enhancement: build the region array by hand vs API
We know how Windows likes it regions: left to right, top to bottom and no row overlaps another row. Well, if we can put those rectangles into an array in the proper order, we can bypass those other costly API calls and simply call a single API when we are all done arranging the array. That API is ExtCreateRegion. Enjoy

Edited: Attachments
1. The code in a text document that can be changed to .bas if desired
2. A really simple sample is also provided. The sample form only has 2 lines of code.
3. The "fun example" uses the shaper as a basis for creating some neat special effects using regions in different ways. It also uses a host of other region-related APIs that you may not be aware of. Maybe it'll get those synapses firing.

Excel Pagesetup Slow On Fast Machine, Fast On Slow One - Why?
I have some code that produces diagram in Excel adds them as new forms and in the end sets up the page for printing. I need to run this on two machines. Both NT4 SP6, Excel2000, Laser Jet 2100TN.
While on one machine(actually the one with the slower CPU and less RAM) the code executes with lightning speed (few secs for 100 diagrams) on the other machine it will take 10 - 20 seconds PER DIAGRAM. The problem lies with the page setup code where each line takes ages to execute. (example: chart.pagesetup..TopMargin = Application.CentimetersToPoints(5) 'will take 2 secs)

Obviously there must be some setting responsible for this. My problem is I seem too blind to find it.

Does anyone know what is causing this behaviour and how to control it? Guesses welcome!

Helger

When I Minus 4 From 4.09 Then Answer Comes 8.99 Something Can Anyone Tell Me How Can I Get Right Answer
when i minus 4 from 4.09 then answer comes 8.99 something can anyone tell me how can i get right answer ...?

Network Help SMALL REALY SMALL!
If im on a network how and my PC name is 17-13-34 how can i send a net send message to the Admin i tryed
17-13-00
17-13
17
Nune worked??

I Need Help Fast
i need to know if at all possible that you can make either a picture or a label fade in and out, and if so, what the code would be to execute that! if you know how, please reply as soon as possible, thanks!

Need Help Fast!
My access program is having problems using one of its dll files: msadox.dll

In my references for VBA it says "MISSING: Microsoft ADO Ext. 2.7 for DDL and Security

I need this working, and fast. So, my questions are this, a. Where can I get msadox.dll to put back on my comp? b. What other solutions or courses of action can I take.

braden

Too Fast... Or What?
Hello,
i'm building a procedure... and i'm becoming crazy in a so stupid sequence...
i think...

in a few words...
1) i add a record to a table
2) i refresh a form using the table i have updated

if i do so, nothing happen at the second step, it feels like nothing has changed, even if i put a doEvents between the two....

if i put a msgbox instead of doEvents, everithing works fine....

so i don't know how to solve this... any suggestion?

thenks!

How Fast Can VB6.0 Go
Hi there,
I need to read 2 input from palleral port and 1 of it is a 40kHz clock. My program will go like this, i will check the clock whether it is HIGH or LOW. Everytime the clock go HIGH then i will read data from the 2nd input.

But i wonder can VB6 manage to work with the 40kHz or 25us input or not.

By the way, can i make a delay with 25us???? Since the Timer only can be set in miliseconds.

Next, can anyone help me to check the codes below, everytime i run it, my program will hang. But i don't know whats the problem.

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

Private Sub cmdStatus_Click()
count2 = 1
count1 = 1
count3 = 1
count4 = 1
value2 = Inp(PortAddress + 1)


Do
value3 = Inp(PortAddress + 1)
count3 = count3 + 1
Loop Until Not (value3 = value2) Or (count3 = 500)


For count2 = 1 To 2000

If value3 = 255 Or value3 = 127 Then

If value3 = 255 Then
Text2.Text = Text2.Text + "1"
ElseIf value3 = 127 Then
Text2.Text = Text2.Text + "0"
Else
Text2.Text = "Input Not Consistant"
End If
Else
Do
value3 = Inp(PortAddress + 1)
count4 = count4 + 1
Text2.Text = Text2.Text + "6"
Loop Until (value2 = 255) Or (count4 = 500)

End If

Text2.Text = Text2.Text + "3"
count2 = count2 + 1
Next count2

End Sub

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

Thanks.

NEED HELP FAST!
I've screwed up bad. I released a program using a different installer than the one that comes with Visual Basic because I don't like the VB installer. Anyway I installed in on another computer and I get an error during the program. It says "msstdfmt.dll not found. Class needs to be registered." Does this mean I have to register the files in the registry with my new install program??? I think I'm in a lot of trouble here.
Does anyone know the registry keys that have to be added??


CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>

Fast Ez Q
working on an admin program
i want to force the user of my program to click "ok" on a message box before they can continue doing anyting else, including anything outside the app.

Need Help Fast..HELP!!!!!!!
I been trying this over and over and I just cant get it right. I need to load both of the files below into two seperate arrays. I then want to load the ten Students SS# into a combo box so when i select a SS# from the combo box all the classes the student is taking will show up in a text box. I have to do it this way using the .txt files. If someone could just show me a quick example of how to load both files into an array that would be alot of help.


StudentData.txt

Jones,John,254-52-6587
Mill,Alex,542-65-9847
Gorin,Amy,147-65-9847
Bevin,Holly,441-65-6521
Vinson,Victor,546-98-9874
Branson,Cory,524-65-6321
Ingrin,James,635-44-9218
Raines,Elizabeth,225-63-4158
Muncie,Alex,226-63-5974
Penn,Terry,335-62-8547

ClassData.txt

254-52-6587,Intro. to Health
542-65-9847,Excercise Science
147-65-9847,Kinetics
441-65-6521,Kinetics
546-98-9874,US History I
524-65-6321,French III
635-44-9218,Micro. Apps
225-63-4158,Business 101
254-52-6587,COBOL I
254-52-6587,COBOL II
542-65-9847,Biology
147-65-9847,Chemistry I
441-65-6521,Band
546-98-9874,Biology II
524-65-6321,Band II
635-44-9218,Biology III
225-63-4158,History II

Need Help FAST!!!!! Due 4/16/02
I am enrolled in an Intro to programming in visual basic class. I desperately need help on a program. We are simulating a slot machine. We do not need to create a form, only a code under the sub form_load and then copy and paste the results from the notepad. I have the majority of the code finished but I do not get the correct results (I get all 0s).

The slot machine pays at 3 levels-low, medium, and high as follows:
-low pays 10 quarters,3% probability
-medium pays 20 quarters,2% probability
-high pays 50 quarters, 0.5%Probability
(No payout 94.5% of the time)

for each session a player starts with a pile of 40 quarters. he feeds the quarters into the machine one at a time pullling the handle and of course hoping for a payout. if he gets a payout he adds these quarters to his pile so he can play longer. he'll cont. playing until one of three things happens:
-he runs out of quarters (goes bust)
-he has double his starting money in his pile
-he plays 80 quarters ie pulls the handle 80 times

your program should display the results of each session in the immediate window using Debug.Print statements. for each session:
-display the session(player) number along with column headings for the play(pull) number and payout amount
-for plays(pulls) that result in a payout display the play number and the payout amount
-display the final result of the session ie why the session ended (there are three possibilities listed above)

after the session results, display a final summary including
-the number of quarters the casino took in (number of quarters played by the players)
-the number of quarters the players collected (number of quarters the casino paid out)
-the winner-the casino wins if it takes in more than it pays out, the players win if as a group they collect more than they play, or it could be a tie

Here is my code so far based on the instructions given by my professor listed above.


'Program to illustrate random number generator and nested loops
'Simulates slot machine

Option Explicit

Private Sub Form_Load()

'Constants

Const sngLowProb As Single = 0.03 'Probability of low payout
Const sngMedProb As Single = 0.02 'Probability of medium payout
Const sngHighProb As Single = 0.005 'Probability of high payout
Const sngNoProb As Single = 0.945 'Probability of no payout
Const intLowPay As Integer = 10 'Low payout amount
Const intMedPay As Integer = 20 'Med payout amount
Const intHighPay As Integer = 50 'High payout amount
Const intNoPay As Integer = 0 'No payout amount
Const intInitialQuarters As Integer = 40 'Amount of initial quarters
Const intMaxPulls As Integer = 80 'Maximum number of pulls
Const intSession As Integer = 10 'Number of sessions

'Variables

Dim intQuarters As Integer 'Amount of quarters
Dim intPulls As Integer

Dim intSessionCtr As Integer 'Counts number of sessions
Dim intPullCtr As Integer 'Counts number of pulls in a session

Dim sngX As Single

'Set random number seed to system clock

Randomize Timer


'Loop through all sessions

For intSessionCtr = 1 To intSession


'Loop through all pulls in a session


Do Until intPullCtr = intMaxPulls Or intQuarters = 0 Or intQuarters = 2 * intInitialQuarters
Loop

intPullCtr = intPulls + 1

sngX = Rnd()

'Determine outcome for this session

If sngX = sngMedProb Then
intQuarters = intQuarters + intMedPay
Debug.Print intQuarters

ElseIf sngX = sngLowProb Then
intQuarters = intQuarters + intLowPay
Debug.Print intQuarters

ElseIf sngX = sngHighProb Then
intQuarters = intQuarters + intHighPay
Debug.Print intQuarters

End If





'Report session findings

Debug.Print "Session #"; intSessionCtr; "Play #"; intPullCtr; "Pay Out"; intQuarters




Next intSessionCtr
'Report final results

Debug.Print
Debug.Print "*-*-*-*-*-*-*-*-*-*-*-*-*"
Debug.Print "Final Results"
Debug.Print
Debug.Print "Session #"; intSessionCtr; "Play #"; intPullCtr; "Pay Out"; intQuarters











End Sub





I would greatly appreciate your help. I am starting to love programming but it is very frustrating at times.

THANK YOU FOR YOUR HELP!

Need Help Fast!!
I need to know if there is a way to convert a power point presentation into an AVI (in VB) so I can put it on VHS. If so, it needs to be done by tomorrow night (June 16).

Really Need Help Fast
i am stuck and the deadline is running fast. I have a quiz program and i want it to load the questions from a txt file. and then ranomise. an then i need to make every correct answer to be worth the number of question.

If you can just help me on one of the question forms an then i can do the rest. If possible can you please leave me some comments in the code.

Can you please help me in speed. thank you

Help Me Fast!!
Hy
I want to know how can I display many records (en ACCESS database)....
The records are in a query with two tables///

THANKS
DIANA

I Need Help Fast
i need to know if at all possible that you can make either a picture or a label fade in and out, and if so, what the code would be to execute that! if you know how, please reply as soon as possible, thanks!

Need Help Fast!!!
HI,
I need help fast, i've just started using vb and i need to add data into a database via a program. I dnt know about modules and all that im still learning. WHEN I TRY THE adding.recordset.addnew command i get a runtime error. y?

Sql.. Fast!..
i need to ask one question regarding sql..
which one of the follwing statment will be faster when there are about 10,000 records...?..

select * from intakes order by intaekid;

(there are about 15 fields and 10,000 records)

or

select intakeid, name, class, subject, age, sex from intakes order by inatkeis;


which one will be faster? using * or specificying the required field?..
Thanks

Need Help Fast!
Hi, I got a big test for tomorrow in school and I need help on visual basic.
I must confirm 8 pictures in a form. 8 moons in a cirkel and when i show one moon the other one disappears and it goes on like that. first of all they all visible=false but after a while moon1 shows and disappears and then moon2 shows and disappears and then moon3 shows and disappears and it goes on like that. Anyone that can help me?

8 pictures, one picture shows and then disappears and then picture2 shows and disappears then picture3 shows and disappears and it goes on like that.

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