Comatose 290 Taboo Programmer Team Colleague

As for playing a sound, yes. There is 1 or 2 ways to go about doing that..... as for Changing the output of the sound..... I'm not so sure.

Comatose 290 Taboo Programmer Team Colleague

Hmn, I don't seem to get that error when I run your code on my box... I wasn't sure how your ABP-FET Reference.xls file looks, so I kind of guessed, and maybe that's the issue (probably, if it's a problem with a text range), but umn..... it seems to work for me....maybe you could attach both the .xls file and the .vbs file in a .zip file.

Comatose 290 Taboo Programmer Team Colleague

Is it all in the same line, like the picture that you have posted? If not, how does it look exactly, can you paste some of the file in code tags. I can help you much more with that then.

Comatose 290 Taboo Programmer Team Colleague

No doubt about that ;)

*Rubs His Hands Together, and Laughs like the Crypt Keeper* Welcome Dan...

Comatose 290 Taboo Programmer Team Colleague

In the properties toolbox on the left (by default) find the "icon" property, and change it to the path and filename of the .ICO file you want to use....

Comatose 290 Taboo Programmer Team Colleague

You need to use the commondialog control. So, Click the Project menu, then select componants. In the new window find microsoft common dialog control, and put a check in it. Now Hit Ok. A new control appears in the toolbox, double click it (or drag it to the form). Then, in a command button (or whenever you want to use it), do this:

dim chosenfilename as string
commondialog1.showopen
chosenfilename = commondialog1.filename
if chosenfilename = vbnullstring then
     msgbox "Please Select A File"
     exit sub
end if

After the code above, The variable chosenfilename with contain the path and filename to whatever the user selected.

Comatose 290 Taboo Programmer Team Colleague

Make sure you read the tutorial in the sticky thread: http://www.daniweb.com/techtalkforums/thread41057.html, and another alternative is to actually copy the file (with VB) to a new location with a new name, and then have an SQL query to remove all the records....

Comatose 290 Taboo Programmer Team Colleague

Stick This in a module (or in the declarations of the form)

Public Sub LoadTextBox(NotepadFile$, XTextBox As TextBox)
Dim chk As String
Dim hld As String
If Dir(NotepadFile$, vbNormal) = "" Then
    MsgBox "File Not Found: " & NotepadFile$
    Exit Sub
End If

Open NotepadFile$ For Input As #1
Do Until EOF(1)
    Line Input #1, chk
    hld = hld & chk & vbNewLine
Loop
Close #1

hld = Left(hld, Len(hld) - 2)
XTextBox.Text = hld
End Sub

Then call it like this (from a button, or on form load, or whatever)

FName$ = "c:\path2yourfolder\notepadfile.txt"
LoadTextBox FName$, Text1
Comatose 290 Taboo Programmer Team Colleague

Read This Thread:
http://www.daniweb.com/techtalkforums/thread37479.html

Basically, you have to create an object of the excel.application class. This will allow you to manipulate the object as you see fit..... such as setting it's visibility and some other fun gadgets that come with it's methods and properties.

Comatose 290 Taboo Programmer Team Colleague

Ok, sorry about that..... I looked a little deeper into the situation, and it seems that it's a known flaw (sorting dates) with the flexgrid control.... here is a workaround: http://www.freevbcode.com/ShowCode.asp?ID=5703

Basically, you use a hidden column to sort the data, and then repopulate..... let me know how this turns out for you, or if you need more help with this.

Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague

you can post it here, but make sure you use code tags. You do this by enclosing the source in [ CODE ] and [ /CODE ] but don't use spaces.... all one word.

Comatose 290 Taboo Programmer Team Colleague

Post the Perl code...

Comatose 290 Taboo Programmer Team Colleague

I hate to give up fun little tricks like this.... but I suggest that you use the API to change the parent of the word window, to a form in your project. Then, simply ensure that your form is not visible.... you can decide to give the parent the child back after the poke should you want to, but it's hardly necessary.... so long as you keep your form the parent of the window, the dde should not affect it's behavior.....

Comatose 290 Taboo Programmer Team Colleague

You could also use load... which works just as well. Start a new project, and add a textbox... leave it's name alone (Text1). In The Properties Box, change index to 0. Now, in your form load (or in a button) add this:

For I = 0 To 9
    If I <> 0 Then
        Load Text1(I)
        Text1(I).Top = Text1(I - 1).Top + Text1(I - 1).Height
    End If
    
    Text1(I).Visible = True
Next I
Comatose 290 Taboo Programmer Team Colleague

I've had my XP box crash on me a good number of times recently (clean of viruses and malware) just silly crap.... like when I empty the recycle bin or something..... I've never (ever) had linux take a dump on me, unless it was my own fault.... As a programmer (in both envirionments) the structure of Linux flat out tosses windows to the curb.... takes it, hands down.... and as far as reliability and security is concerned......

Comatose 290 Taboo Programmer Team Colleague

Nice Job. If you are trying to get the item that is selected in the listbox, you could use list, instead of item, but nicely said.

Comatose 290 Taboo Programmer Team Colleague

I don't see the problem.... VB is reading data from the serial port right? So should it matter if the form's .visible property is true or false?

Comatose 290 Taboo Programmer Team Colleague

That's absolutely right. It's not often that people use option explicit, since VB allows you to be Sloppy and Creative... and beyond that, you should declare all your variables anyway, using option explicit or not....so you are absolutely right:

Public Sub Die()
Dim XFrm as Form
for each XFrm in Forms
     unload XFrm
next XFrm

end
end sub
Comatose 290 Taboo Programmer Team Colleague

Simplicity for large-scale apps. Let's face it, I'll build my messenger in VB before you will build yours in C. Now, if you take into account the ACTUAL LANGUAGE, well, you're right... VB sucks. It lacks the power of pointers (excluding AddressOf, but it's not really a pointer per se), it requires runtimes, AND it usually produces a larger .exe than needs be..... HOWEVER, you can put some serious power behind VB with API calls and the use of AddressOf.... Anyway, The answer to your question is: Simplicity.

Comatose 290 Taboo Programmer Team Colleague

I've been working in VB for over a decade (10 years), Interfaced VB with RADIUS Servers, and Linux Side Perl with Sockets, and have been a senior programmer for a corporation doing VB..... I'm not here challenging your credentials (nor should you challenge mine) and while there may not be any errors in doing this kind of programming, it's poorly written code. Anybody who has written code in a language other than VB, understands very well that scope is a very important aspect to programming. Scope keeps variables maintained, and it saves space in RAM by not having to span multiple procedures. Fact is, if you don't need the variable outside of the procedure, you shouldn't declare it outside of the procedure..... it's bad programming practice.

While the solution you provided can/will work, professional code simply should not be written that way. My AIM here is to provide more than a solution..... it's to provide people with a solution that fits into proper programming style.

Now, I'm sorry if I offended you with my previous post negating your post, I understand and appreciate that you are being helpful, but it's important for programmers to understand that vital role of variables in scope.... which Is why I posted what I did.

Comatose 290 Taboo Programmer Team Colleague

Fooey, use the DIR command.....(stick this in a code module):

public function FileExists(sPath as string) as boolean
If Dir(spath, vbnormal) <> "" Then
     FileExists = True
Else
     FileExists = False
End if
end function

Then call it from your code like this:

if fileexists("c:\fileinquestion.txt") = true then
     msgbox "the file exists"
else
     msgbox "the file dos not exist"
endif
Comatose 290 Taboo Programmer Team Colleague

*Sigh*

Comatose 290 Taboo Programmer Team Colleague

Right, but as per my previous post, this method is depreciated..... it's bad programming practice to put variables outside of their scope of intended use.....

Comatose 290 Taboo Programmer Team Colleague

Create a Module (Code Module) and add this:

Sub Die()
for each XFrm in Forms
     unload XFrm
next XFrm

end
end sub

Then, in your project on the "exit" menu, AND in the main windows form_unload, just do this: Die This method, actually is 100,000 times better than using end... it's much more graceful, and it gives all the forms an opportunity to clean up after themselves. Then, any and every place you need to end the main program, just call the Die sub, and you are good to go.

Comatose 290 Taboo Programmer Team Colleague

In The Textbox's GotFocus() Event (Assuming the textbox is text1)

Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
Comatose 290 Taboo Programmer Team Colleague

Indeed, Good Job To Both of you.

Comatose 290 Taboo Programmer Team Colleague

You can declare them at the form level, or you could simply replace each occurance of Dim with Static. Static allows you to make a procedural variable, that will maintain it's value until manually reset (or the object in which it resides is destroyed). It's good programming etiquette to use static as opposed to declaring your variables at the form's scope, because in this case, you have no need or desire to use that same variable in a different procedure on the same form. This keeps structure and organization in your code, and doesn't use as much memory by having to span the variable to different procedures.

Comatose 290 Taboo Programmer Team Colleague

Eah, it was late and I was burned out from a long trip :) I meant right.

Comatose 290 Taboo Programmer Team Colleague

The Timer Control is a control that makes a certain set of code execute at a given interval. It gets set in milliseconds, so 1000 is 1 second in the interval. The purpose of a loop is to execute a given set a code either a given number of times, or until a specific condition forces a change that will stop the loop.... a timer control just simply executes a set of instructions every so often. Also, with a timer control, your app is free to have other events happen, in between (or even during) timer events.... which reduces your need to use doevents, and also saves on Processor Time.

Comatose 290 Taboo Programmer Team Colleague

I'm sorry, I'm having a very hard time understanding what you are trying to accomplish. You have a database that stores information about the faculty, and you want to do what exactly with it?

Comatose 290 Taboo Programmer Team Colleague

Yup, he's right. Truth is, that's exactly what the timer control is for.

Comatose 290 Taboo Programmer Team Colleague

Post some code for it.

Comatose 290 Taboo Programmer Team Colleague

Yup, that's right... do me a favor and toss in some code tags ;)

Comatose 290 Taboo Programmer Team Colleague

Batch files had no means of playing sound through the speaker.... QBasic, debug, or some other file could have been called by the batch file to spawn the app that plays a text to speech, but batch files themselves are not a language, and lack the kind of power required to perform text to speech.

Beyond that, this is a Visual Basic Forum, and if there was/is an external app that needed to be spawned, VB could do it all by itself. Now, if you could somehow show the VB code to create your super-batch file, by all means, I'd love to see it, and so would many others... but just do me a big favor, and try to keep the post relevant and helpful to the forum/thread. Thanks Bud.

Comatose 290 Taboo Programmer Team Colleague

I think you have to manipulate the printer object directly.....

Comatose 290 Taboo Programmer Team Colleague

That's freaking awesome.... not that you need them, I'm still giving rep points for that one Alex

Comatose 290 Taboo Programmer Team Colleague

Umn, let's try to keep different questions in seperate threads.

Comatose 290 Taboo Programmer Team Colleague

;) No Problem.

Comatose 290 Taboo Programmer Team Colleague

after you clear the textbox's, add this line: prodlist.removeitem prodlist.listindex

Comatose 290 Taboo Programmer Team Colleague

should be... look into the sendkeys command.

Comatose 290 Taboo Programmer Team Colleague

Yes, but it's going to vary depending on the application you want to automate.

Comatose 290 Taboo Programmer Team Colleague

So, you want to delete the stuff from the VB program, but not the oracle database? The problem, I'm guessing, is that when you delete an item from the listbox, it's not updating the database..... so the information remains? If you post the code, I can take a look for you.

Comatose 290 Taboo Programmer Team Colleague

right, but aren't the hyperlinks jacked? Like if the link references the same domain, but a different page?

Comatose 290 Taboo Programmer Team Colleague

Well, Like I said, I can get it to not move from it's location...... but getting rid of the line that says "ha ha", well, that's another story.

Comatose 290 Taboo Programmer Team Colleague

I just recently learned that canned responses are responses that are already premade. So, they can scan a Hijack This Log, find the problem, and paste the solution (already prettied up with BBCode Tags and all, so it has bullets and color, and fun stuff) without having to type it over and over for the same spyware/virus problem. I think they are kinda sexy....

Comatose 290 Taboo Programmer Team Colleague

Sounds like a problem with some of the .dll's, have you tried reinstalling VB?

Comatose 290 Taboo Programmer Team Colleague

in the evaluate function, you may need to use split to rip apart the expression, and then assign the elements of the variant array to the respective variable types.... Or don't use string, use variant.

Comatose 290 Taboo Programmer Team Colleague

Wait, What? Your selling banners of social networking to companies? I'm talking about being able to not be listed on a social network, not blocking banners.

Btw, I was kidding.... I don't really mind, but I wanted to throw something in there about AT & T selling logs to NSA..... :)

Comatose 290 Taboo Programmer Team Colleague

Is this user disable-able? Sounds like you have been working with AT&T, and NSA?