Wow, that's uh, the wrong language.
Comatose 290 Taboo Programmer Team Colleague
Wow, that's uh, the wrong language.
Thank you Sir.
If NOT [B]isNumberic[/B](Textbox1.value) then Msgbox("Sorry you must only put numbers") else end if
It's a cleaner code method to not include an else unless it's being used. Also note that VB6's textbox's do NOT support the .value property, instead, use the .text property. So, the above code example:
if not isnumeric(text1.text) then
msgbox("Sorry you must only put numbers")
exit sub
end if
You should do it in the keypress event of the textbox, check this thread: http://www.daniweb.com/techtalkforums/thread51931.html
Her last post regarding the project was Dec 30th 2004, I bet she's finished with it by now.
Yeah, I think he was after a tooltip, like when you hold your mouse over a button and it tells you what it does.
You put Knoppix on a CD, and it becomes "bootable", but it's a version of unix, and I'm not so sure that it's as user friendly as PTY suggests.... I suppose the right distro is.... anyway, you put the CD in, turn off the computer, then turn the computer on (with the CD in the drive) and boot to the CD.
Good Call
Good Job Hollystyles
A Combination of using the CreateWindowEX API, with a class of TOOLTIPS_CLASS, and then set it's style of TTS_ALWAYSTIP. The tooltip window would be a child of your form, and thence destroyed when you close your form..... Let's see...http://www.thescarms.com/vbasic/tooltip.asp
Ok.... I'm not sure exactly what it's going to entail.... do you have the buttons already added for the scientific portion? Attach your project to the next post, and we'll go from there.
Yeah, give that a shot.
That's an excel divide by 0 error.... is your app doing something with excel? If so, maybe
A) Excel is not install on the client machine
B) Wrong version of excel for the method/operation your app does
C) problem with a calculation in the excel document
You could TRY throwing in an on error resume next
just before the saveas line, or an on error goto handler
, but then you need to make a handler: label to goto. I don't know if that will work or not, because if the error is with the excel object, your app will have little or no say in the objects internal error handling technique.....
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Long, ByVal dwFlags As Long) As Long
Public Const LWA_ALPHA = &H2&
Public Const GWL_EXSTYLE = (-20)
Public Const WS_EX_LAYERED = &H80000
Public Sub Phantomize_Window(hwnd As Long, bytOpacity)
'phantomize window
Dim buf As String * 1024
Call SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) Or WS_EX_LAYERED)
Call SetLayeredWindowAttributes(hwnd, 0, bytOpacity, LWA_ALPHA)
End Sub
Phantomize_Window Me.hwnd, 65
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....
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.
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.
:eek:
check this thread out: http://www.daniweb.com/techtalkforums/showthread.php?t=41491&highlight=datediff
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?
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.
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.....
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.
Eah, it was late and I was burned out from a long trip :) I meant right.
Post some code for it.
Yup, that's right... do me a favor and toss in some code tags ;)
I think you have to manipulate the printer object directly.....
;) No Problem.
after you clear the textbox's, add this line: prodlist.removeitem prodlist.listindex
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.
right, but aren't the hyperlinks jacked? Like if the link references the same domain, but a different page?
You want to embed excel into the form, or you want to read the excel data and display it?
If it's a folder (BIT) then del won't get rid of it. You'll have to use rd or rmdir (same command). so, something like: rd /s "c:\my shit\BitTorrent\BIT"
did you try the link http://www.purgeie.com/delinv/index.htm and see if that program works.....
Also, something else that throws me, is if that file is the one that won't get deleted, why does it say: CAIDWFIT? Is CAIDWFIT the file inside the BIT folder? Also, bit torrent isn't running when you try to delete this is it? If so, naturally, it won't work. If bit torrent is NOT running, and the dos commands don't work, let me know.
You can go into Dos, and try to delete the file manually using it's short name..... or trying doing it using wildcards. You could also try this tool:
http://www.purgeie.com/delinv/index.htm
If the file is not invalid (assuming this tool doesn't fix the problem) let me know.... either the filename is invalid, and windows can't access it (for a number of reasons), or another app is using the file and won't release it (in which case I can get around that). Let me know.
What's the path to the file? It's on the desktop? Also, are you able to do anything to the folder, such as set attributes (system, hidden, read-only) or can you do absolutely nothing with it?
One problem that a lot of people don't understand is that an if statement has 2 different syntax. The only time you have to "end if" an if statement, is when the if statement is on more than 1 line (or if it does more than one thing). So for example, if I want to make this program change the value of a variable, display a msgbox and leave the sub, I would do this:
somevariable = 1
if x = 5 then
somevariable = 10
msgbox "changed somevariable to 10"
exit sub
end if
However, let's say all I want to do is change the variable, and that's it.... just change the variable and move on, if x = 5:
somevariable = 1
if x = 5 then somevariable = 10
And that will work just fine..... in fact, it will give an error if you put a end if..... without have a "block" of code.
Another thing to keep in mind, is that it really isn't a good practice to put code that should be on 1 line, in more than 1 line. For example, the underscores used in your first if block. While VB allows you to do this (and it's supposed to be for readability) you shouldn't. Each line should represent a different purpose..... it keeps things in order. If you are comfortable programmang with the _, then keep doing it, but be aware on team projects and larger scale apps, you will …
do you want to be able to enter the new IP, or just have it changed to a predefined IP?
It's best to keep things on the site, so that other people who have questions like yours, can get them answered too. I'm glad to help, however.
Yes, but are you refering to a static IP (like one that is assigned by you, and only changes when you want it to) or a dynamic IP like DHCP?
Check it out, VBScript is a scripting language (which means, it does not need a Compiler in order to run). VBScript was made originally for use on the system, to replace DOS Batch Files (in a sense) with the windows feel of batch files. It uses the same BASIC Syntax as Visual Basic, or even QBasic, but it's much more object oriented. It's also, much less powerful. There are a couple of methods to writing VBScript, and it depends entirely on what your intentions are. It is possible to include VBScript into a web page, which would essentially be a replacement for Javascript. This would allow you to control web page elements, such as when a user places the mouse over a picture (a mouseover) or when an object is clicked.
The other way, which was mentioned earlier, would be to use VBScript as a gateway to the Windows Scripting Host . This would give you the ability to control some things on the system, such as opening, reading and writing files, or sending up msgbox's or inputbox's for user input. VBScript has also been known to be useful in automating Office Products, such as word, excel, or an Access Database.
Depending upon your want/need, would depend on how you would go about writing the VBScript. You would need to know and use HTML (Web page language) in order to effectively use VBScript in your web site. If you want to use …
;)
Make sure to read the sticky thread: http://www.daniweb.com/techtalkforums/thread41057.html to get you started. Read this page for info on the error message: http://support.microsoft.com/kb/155666
Content-Type: Inappropriate
"Woman who dance wearing jock strap, have make believe ballroom"
-=Confucius=-
Jt: I'm not arguing that Saddam shouldn't have been brought to Justice.... certainly he should have.... but how I, and many other people in the U.S. feel, is that W. Used the attacks on 911 and the hunt for bin laden to go after Saddam. This "war on terror", which came about mainstream due to the attacks of 911, and this "OIF (Operation Iraqi Freedom)" have nothing to do with one another..... but many Americans were lead to believe, by our President, that somehow they were/are connected.
At the start of OIF, the majority of the population supported the war, and little by little, people started to speak out against it.... I just want to ask you, how much support for going into Iraq, do you think the President would have had, had 911 not happened?
I think on XP (I don't have a password, I just turn it on and get my desktop), but if you are set up to log on, with a user and password, after you zip the file, I think you can go to properties, advanced, and then click "encrypt contents to secure data", but I'm not sure if that's actually password protecting the zip file.
The problem I have was how it was intermingled with the attacks on 911. I've not seen any conclusive evidence that supports Saddam as having ties to Bin Laden (in case you forgot, the culprit of the 911 Attack). If there were/are ties, I'd like to see those.... but I suppose taking someone's word for it is good enough?
While I push for pulling out of Iraq, you have to ask yourself.... what happens if we leave? Do you think it would be right to show up, take over, and bail? Do you believe that we have trained enough Iraqi Police and Military to be able to stand up on it's own?
Technically, you could have "gone the other way", but when doing a for loop, it's default behavior is to count up. So, behind the scenes there is a test condition being applied to the for loop.... for example: for I = 0 to 9
is going to say "ok, is I less than 9" if the answer is yes, then do the stuff between for and next. Then, it's going to Add 1 to I, and say "ok, I is 1 [then 2 and 3, etc, etc], is it less than 9?" It will continue this process until I becomes 9. When you say: for I = 10 to 1
, the programming language isn't going to change it's behavior, just because you decided to change the numbers.... so, dutifully, it says: "ok, I is 10 right off the bat, is I (10) less than 1 (or -1 or whatever)". Naturally, 10 is not less than 1 or negative 1.... or even 9, so the for loop never actually even runs once. It just compares, sees that 10 is not less than -1, and says screw it, and moves on.
You can change the behavior of the for loop, however, to decrement instead of increment (to count down instead of up) but be advised, that this is not the standard way of doing things. Meaning, if you ever share your code with someone, or you end up working in a team setting, someone might have a more difficult time …