I'm pretty sure you can use defined in javascript. You can try:
if (defined(somevariable)) {
alert(somevariable);
}
I'm not sure, but I think that's accurate.
I'm pretty sure you can use defined in javascript. You can try:
if (defined(somevariable)) {
alert(somevariable);
}
I'm not sure, but I think that's accurate.
dim objExcel
set objExcel = createobject("Excel.Application")
objExcel.Workbooks.open "c:\somepath\somefile.xls"
objExcel.Show
Have you played with the internal printer object, or printer collection? What you can do, is set the printer to a different index of the printer collection (behaves more like an array). An example would be:
' /* Set The Printer To the First Printer In the OS */
Set Printer = Printers(0)
' /* Code To Print The Document */
Printer.Print "change this to something to print your document"
' /* Set The Printer To the Second Printer In the OS */
Set Printer = Printers(1)
' /* Code To Print The Document */
Printer.Print "change this to something to print your document"
' /* Set The Printer To the Third Printer In the OS */
Set Printer = Printers(2)
' /* Code To Print The Document */
Printer.Print "change this to something to print your document"
The above code should print the line: change this to something to print your document to 3 different printers on the system (0, 1, 2). So all you have to do to change the printer is set Printer to whichever index of the printers array (collection).
Well, With javascript it is going to require you to use cookies. You send the browser a cookie, with the value as the number of visits. Next time they return, read the cookie, increment it, and over-write the cookie with the new value. In order to do something like this SERVER SIDE, you'll need a server side language, such as perl, php, or some other server side programming language.
I'm sure that you will first have to close the database. If you sift around for the methods of the control, there should be one for disconnecting or closing the connection to the database. Another option is to make the control a control array, when you are done with that particular connection, unload the control, and then load a new instance of it in the control array. Here is a link to working with Access Database from VB Code, and may be more beneficial to you:
http://www.timesheetsmts.com/adotutorial.htm
Hmn, Maybe I should make this link sticky, it seems to be a pretty popular item, so here is the link to a page regarding Access Database with Visual Basic:
http://www.timesheetsmts.com/adotutorial.htm
Too Bad They want to stop support of VB6 :(
Here is a good tutorial regarding the use of MS Access with Visual Basic (VB6, VBS):
http://www.timesheetsmts.com/adotutorial.htm
*shrugs*
Whatever Works!
I'm not sure if there is a more efficient way to do this, but it seems the best way is to have a server program that runs on all the machines who's registry needs editing. Then, you have a "client" app on the machine/machines that will be actually doing the editing. If it's necessary, you could even make the server app and the client app the same program, and so you only have to fiddle with one .EXE. Anyhow, you have the client app connect to the server app, and pass it a command to do whatever is needed to the registry. If there is a better way to accomplish this task, please post and let me know.
There are only a few words that come to mind, but "wow" says it all.
That's certainly going to complicate matters significantly. The only way to see if the PHP page is checking for IP's or Referer, is to actually write a program that sends the data to the server with the cloaked referer. You could do this with telnet, if you know the HTTP Header Information. If it accepts it with the altered referer, then it does NOT use the IP address. But when you through the GET and the MD5 Hash into play, it complicates matters. Now the PHP page is wanting the URL to contain the md5 hash, which is going to be a bit of a pain to pass in the header.
There is a way to do it, but not with the project we have here. There are a couple of ways, however. A Nasty way is to use the "sendkeys" function to sendkeys to the web-browser. This way is tacky, and should not be used if it can be avoided. The best way is to use a socket control, that sends header information to the web site. I don't know if the CGI checks by referer, or by IP address, but if it checks by referer, then it's no problem to mock that referer. To Trick the page into thinking that it's recieving it's data from the page that it needs. What we need to know is if the page restricts by referer, or by IP address.
Also, For "Random" Tips of the day, the way to go about it is to read in all the tips from the database or file into an array, then run the randomize function between the lowest and highest element of the array. Then display the tip that is inside that element of the array. I would personally just use an increment counter. Save it in a settings file or the registry, and just add 1. So like, if you have 10 tips, start at 1, then next time, show 2, then 3, then 4. That's how I would do it, but it's not very random ;)
What I mean is, when I go to http://davidrl41.signmyguestbook.com/, or http://paulowenlewis.com/guestbook/polguestbook.html, the date still shows as: 12:22 am - Monday,April 11, 2005
If you change the - to a / it shows up as: 12:22 am / Monday, April 11, 2005, right? When I go to those websites, I'm still seeing the date with the -, so it appears as though it has not been changed in the HTML file. The .pl file only writes to the HTML file when there is a new post, and for that matter, it only writes the new post... it doesn't re-write any other information. I'm going to copy the source HTML page to my server, so that I can tinker around with it, and see what is happening with the date.
*puts on his sunglasses*
So, It showed up the same as before, with the -, even when you changed it to a /????
Something just struck me like a ton of bricks about this too! The .pl file ONLY CHANGES THE .HTML FILE WHEN THERE IS A NEW ENTRY!!! That slipped my mind altogether. Basically, Only new entries would have the "changed" date, not the ones that are already there, because that time and date has already been written to the .HTML file in that format. So, only new entries would show up with the new date and time format. Also, the old entries would have to be changed by hand in order to look the same as the new entries!!!! I forgot completely that it re-writes the .HTML file, and only adds the new data! Sorry about that, I should have caught that one sooner!
I'm not 100% sure what you are asking. Are you asking how to transfer a sound file in an e-mail??
Well, at the "# Open Link File to Output" section, where you see:
if ($separator eq '1') {
print GUEST " - $date<hr>\n\n";
}
else {
print GUEST " - $date<p>\n\n";
}
Try changing the - to a /, and if that doesn't work, I'll put on my sunglasses, and start digging into it in my infamous "Code Mode" ;)
Sure Can. The command that the .pl file is using to get the date and time is the unix date command, which is found under /usr/bin, you can see that it refers to the path here:
$date_command = "/usr/bin/date";
Now, the date is actually called twice, in 2 different formats. A Short Format and A Long Format, Which is saved into 2 different variables here:
# Get the Date for Entry
$date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`; chop($date);
$shortdate = `$date_command +"%D %T %Z"`; chop($shortdate);
I don't know the version of unix that this page is being hosted on (or even if it is unix, maybe it's with windows with active Perl, I honestly don't know), but I know that it is different from the server I host mine on. If you have shell access, which I bet you can connect through SSH (Secure Shell) to the server, you can execute the linux command "man" which is a manual page. So: man date
will give you the manual page about the date command. On my server, It is as follows (on yours, I'll bet it's different):
%A Represents The Day Of The Week (Monday, Tuesday, Wednesday, etc)
%B Represents The Month (april, may, june)
%d Represents The Day Of The Month (19, 20)
%Y Represents The Year (2005)
%T Represents The Time (18:08:21)
%Z Represents The Time Zone (EDT)
Now mind you, that's on my server, the server hosting your page might …
Yes, You need to edit the CGI (the guestbook.pl) in order to modify the appearance of the entries. The thing to understand here, is that guestbook.pl actually edit's the html file that contains the guestbook entries. So, guestbook.pl opens the file polguestbook.html, and reads everything that's in it, into an array. Then, it modifies the information in the array (it adds a new guestbook entry), then it re-writes polguestbook.html back to the disk. If you want to try a little experiment, load the guestbook web page: http://paulowenlewis.com/guestbook/polguestbook.html, and then right click on the page and view page source. Hit F3 (find), and type in --begin
that's where the CGI (guestbook.pl) actually starts making changes to the file. In the CGI, search for: # Open Link File to Output
Everywhere below that where you see:
print GUEST "whatever in here";
is actually where the entries are being added to the HTML file. So, you can modify those lines to contain fonts, tables, or images. This line, for instance:
print GUEST "<b>$FORM{'comments'}</b><br>\n";
is where it actually writes to the HTML file, what the user typed and submitted. So, you could remove the Bold tags, or add italics, or whatever you want in order to make it look the way you want it to. Let me know if this helps, or if you need further assistance.
Something to consider, is setting the database reference to nothing. This should close and unload the adobooks object from memory, and allow you to re-create, and re-open it. I might be mistaken, but it looks like it's mad that you are trying to open a database that is already open.....
Hi everyone,
I'm trying to:
(1) take an excel spreadsheet with two columns of data
(2) convert to tab-delimited text file
(3) import into perl as a hashI've managed to import as an array:
open (LIST1, "list1.txt") || die "File not found\n";
while (<LIST1>) {push(@list1array, $_)};
close LIST1;However, I can't figure out how to either import directly as a hash or convert the array to a hash. If someone could point me in the right direction, I'd be appreciative.
Thanks!
I would do it something like this:
open (LIST1, "list1.txt") || die "File not found\n";
while (<LIST1>) {
($tmpvar1, $tmpvar2) = split(/\t/, $_);
$hashname{$tmpvar1} = $tmpvar2;
}
close(LIST1);
Which will open the file, read in the data line by line, split the current line by the tab character (so that what is in the first column will be in tmpvar1, and what is in the second column will be in tmpvar2) then assign the hash in a scalar context. I've tested it with a tab delimited text file, and it works fine for me.... let me know how it works for you.
Stick this outside any subs (in a module, or the bottom of a form OUTSIDE of any of the existing code)
Public Function GCD_Of(First_Int, Second_Int)
W = "ERROR: "
Err1 = "Invalid numeric argument(s)"
Err2 = "Argument(s) must be non-zero"
Q = CDec(1) ' Initialize quotient as DECIMAL variable type
R = Q ' Initialize remainder
' Read the input argument values
X = First_Int
Y = Second_Int
If IsNumeric(X) = False Or IsNumeric(Y) = False Then
GCD_Of = W & Err1
Exit Function
End If
' Convert input arguments into DECIMAL variable type
X = CDec(X)
Y = CDec(Y)
' Report error if argument(s) non-integer
If InStr(X, ".") > 0 Or InStr(Y, ".") > 0 Then
GCD_Of = W & Err1
Exit Function
End If
' Make sure both arguments are absolute values
If X < 0 Then X = -X
If Y < 0 Then Y = -Y
' Report error if either argument is zero
If X = 0 Or Y = 0 Then GCD_Of = W & Err2: Exit Function
' Swap argument values, if necessary, so that X > Y
If X < Y Then Q = X: X = Y: Y = Q
' Perform Euclid's algorithm to find GCD of X and Y
While R <> 0
Q = X / Y
i = InStr(Q, ".")
If i > 0 Then Q = Left(Q, i - 1)
R = X - Q * Y
X = Y
Y = R
Wend
' …
Check Out This Code snippit (In The VB Code Snippit's section):
Yeah, You're right. I was checking the comments (// and not ') so I immediately thought it was. Sorry for skimming the post (that's what I get) :(
Belama,
While any insight that you can offer would be greatly appreciated, this thread is designated for Visual Basic, While your code is PHP, and will not work in a VB IDE ;)
I haven't used either one, but the Rumor is that crystal reports is "really good"
I have uploaded an HTML document to my WEB site. It looks fine on screen. However if I print it out (via explorer) the font size increases vastly and it looks a mess. I suspect this is a well known problem as I have often seen "printer friendly" documents on the WEB. How do I make my document likewise? At the end of the day I need to upload a document that anyone can print out that looks the same as the on-screen version.
Thanks.
Sorry Mr. Confused, This Doesn't appear to be a visual basic question. It appears to be an explorer question, and so I am moving this thread to a browsers section of the site.
I'm not sure what you mean about 'my internet connection', but I'm sure if you stay online all the time (like dsl, or cable) then you could run userv ftp server, and connect to the computer that way. If you are into writing your own programs for such things, you could code a quasi-server that accepts a username and password, and gives you, say, and web browser interface to your files and folders.... just a thought. For simplicity sake, I'd get the ftp server ;)
Why don't you install userv, or some other form of a window FTP server? Then you can FTP in from work, and access the files on your home PC in an FTP manner.
I don't even know what a dongle system is.... but I will say that going about protecting your program from piracy is going to be a difficult task. There have been hundreds of attempts, most of which fail. You can make it secure from the majority of users, who "don't know", but for a lot of people, piracy is a skill that they are going to keep practicing.
The question is, do you want to build an app that does it for yourself, or do you want to find an app that already exists to use for yourself? That would also clear up where this belongs in the threads too.
Catching Up
In The Previous Tutorials, we have covered a lot of information. We've gone over a few of the functions of the CGI.pm, and and figured out how to retrieve information from a web page form, submitted by the user. However, reading this information, and thanking them by name isn't very productive. Sure it works, has functionality, and gives us understanding, but what do we do with that information? The plan is simple, we'll store this information in a text file.
Flat Files
At it's very simplest description, a "flat file" is just a text file that stores all of your records, 1 record per line. That also means that all of the fields have to be on 1 line. Now, You have to know how these fields are seperated (a record is a whole bunch of fields. So, A Field would be "first name", while a record would contain "first name, last name, middle initial"). Each field has to be seperated by some kind of standard, static character or characters. A Lot of programs like to use the tab character, or even commas. For our purposes, however, we are going to stick with Tabs.
Open, Print and Close
The process for writing the information to the file, is not very difficult at all. It takes a simple 3 step process in order to do this. Don't get me wrong, there are a ton of other methods for saving data, and some …
Hi
I am trying to access my application which sits in the systray. I am writing a test script, for testing this application.I dont want to manually click and open the properties, so I am looking at a VB script based access.Hope this clears your doubt. Please help me out in accessing the systray icons
Ram
I'm still a little confused. The application that sits in the tray. Did you write it? Is it your code? If not, what is the program?
Can someone help me? I am looking to access the properties of system tray processes in Windows. An example of what I am looking to do might be to maximize an application that has been minimized to the system tray? Can I do this in Visual Basic or VB script based
Are you trying to manipulate someone else's program that is in the tray, with your program, or are you trying to make your program go to the tray!? If you could give a better or detailed description of what you want to accomplish, I'll be able to give you better assistance. The simple answer, is Yes you can.... and I'd be glad to help you with it.
I'm not sure that I know of any charts and graphs books regarding VB. All the VB books I've ever seen have a pretty general tone, and cover a variety of things. The only book, that I've ever seen that was specific, was a VB book covering the API. If I run across anything though, I'll make sure to post it.
The code work well . you are a great programmer , Comatose.
but can you explain to me about serversock function . i have a book about visual basic 6 and it doesnt even mention about serversock . where can i find a source that will explain about serversock ?
Be Not confused. Serversock is not a function. It is the name of the socket control. Just like you can name command1 to cmdOkButton, Instead of the Name Socket, I chose Serversock. This was downloaded from Catalyst, and it is called SocketWrench. It is a control that allows communications over the internet. Those communications can be either as a server (a program that listens for a connection) or a client (a program that tries to make a connection). In our case, this socket was a server, as we were listening for a connection on port 135. To avoid confusion a socket is the means by which programs talk over the internet. Windows comes with a socket control called "winsock" but it's not as powerful or flexible as socketwrench. I hope this helps to give you a better understanding.
Are you sure the command button is named properly? Maybe attach the entire project as a zip?
wow guys - i thought it was an interesting you know.. story... didn't mean to get ya'all all stirred up. :)
--Tone
Oh, it was certainly an interesting story :cheesy:
Hmn.... I'm hoping I'm not off on a limb here, but check this URL:
http://www.microsoft.com/exceldev/articles/bulkmail.htm
Wow. I'm not even sure I understand what you are asking. Is it possible to zip and attach the project?
What is the NAME of that textbox?
Educational licenses can only be sold to qualified people.
AFAIK there is no company called "Microshaft" and even if there is any agreement they make with anyone won't have any impact on this case which involved a company called Microsoft.
If a store refuses to take back software sold there, that's no responsibility of the software manufacturer... The purchaser should have been made aware of that at time of purchase (usually via signs saying "no returns on software" or some such). If he wasn't he has a case against the store, but that doesn't give him the right to sell the product to parties who are not entitled to buy it.
Sorry you couldn't catch that pun. Regardless of our feelings about Microsoft, IF MS made a pact with the store (which the article clearly defines), to refuse returns of it's product.... then it is responsibility of the software manufacturer. (I'll give you an extra 2% if you don't accept returns of products with our name on it). Who's at fault there? I also don't see how if he owns something (which he bought it, so clearly he does), how he doesn't have the right to sell it. If I go to the store and by a DVD Player, and before even opening the package, realize that I can't use it with my TV, because it only accepts coax... I have every right in the world to sell it, at my price and my cost.
The TO line of a VB Form?
Did you read it Jw? Microshaft made a pact with the college store to REFUSE returns of Microsoft Products! Thereby refusing him the return that he was entitled to. If the store would have accepted his return (which they refused...) then he would have been content. Also, he even told microshaft about it, and requested to return the product to them, they waited until time ran out for his "30 day return policy" before sending him a "oh, sorry, we don't take it back."
Frankly, Microsoft is up to shady tactics, and IMO downright wrong.
My personal opinion is that MS Is Full of crap. If I buy a bottle of Coca-Cola, and someone says "hey man, I'll give you two bucks for that!". Isn't it mine to sell? I think it is. I bought it at a given rate, agreed upon between party A and B (myself). The deal between B and C has no relation to the deal between A and B. Plain and simple. To dig deeper, He didn't open the package... therefore, he couldn't have even read that "license agreement", moreless clicked "I accept". He never accepted the license agreement, and is therefore not bound to the confines of it. Had he installed it, well... that might be a different story.
I'm not sure about the entire question, but it would be simple to keep track of how many still need to be shipped. Just change the instances of order No so that it subtracts the amount sent, and rewrites it's value to new amount needed to send. I'm not sure about the rest of it though.
Are you wanting to just read the data from the excel spreadsheet, and put that data on the form? Or are you wanting to Embed an excel spreadsheet into the form?
Put the options into a group box. Do you want your brother to pick more than one option or pick the lot? If it is one option put them as radio buttons.(radSquare, etc.) If you want all the options then it would be a checkbox. (chkSquare, etc.) Hope that helps.
I'm sorry.... did you even read his post?
Ok, I'd like to try to help. I have built a program that will help to identify the problem. If you go to: http://www.aftermath.net/~coma/ModScan.zip, download that, install it... and then run it. When you run it, it will create a log file, on the root directory of the c drive (c:\tppscan.log). The first time you run it, run it with no web browser open. Then, close out of it, and rename the log (c:\tppscan.log) to something else (say: c:\firstscan.log). Then open your browser, and if it's been hijacked, run the program again. It will create another log (c:\tppscan.log). Then, either post the 2 logs (identify which one was first and which was second) Or, send them both to me in an e-mail as they will most likely be pretty large (text wise). I'll sift through them and see what If I can find anything.
Oops: just realized it's been fixed! Nevermind!