Comatose 290 Taboo Programmer Team Colleague

yeah This thread should probably be merged with the other one (about the null value problem)....

Comatose 290 Taboo Programmer Team Colleague

Let's not assume, but I'll do what I can if you post the code.

Comatose 290 Taboo Programmer Team Colleague

I'm pretty sure that the parallel port is a device in /dev, I'm not sure which one it will be (depends on which one you are trying to access), but you may have to do a sysread or syswrite on that device (there is probably a way to open it too) let me see:

http://linux.dd.com.au/quest/os-perl/parallelport/
http://www.geekinventions.com/modules.php?name=News&file=article&sid=6
http://search.cpan.org/~scott/Device-ParallelPort-1.00/lib/Device/ParallelPort.pm

That should get you on your way :)

Comatose 290 Taboo Programmer Team Colleague

Well, I'm not 100% sure how you would go about "looking" at the picture in code, and determining if the patterns are the same or not. That's going to be an extremely low level and complicated task, using the type of byte, undoubtedly. You would have to open the image for reading as binary, read in the bytes, and know the format and compare them. Not a pretty task. You could consider having the user give a description of the pattern, and then be able to search by the description (save the description in a file, and search for the description, and have the file contain the path to the picture, so like, the description, a delimiter, and then the path to the image). Other than that, you've hit me with a toughy.

Comatose 290 Taboo Programmer Team Colleague

http://www.daniweb.com/techtalkforums/thread26892.html is a great tutorial over using access with VB.

Comatose 290 Taboo Programmer Team Colleague

Yes, Please Post your code so that we can take a look at it.

Comatose 290 Taboo Programmer Team Colleague

Well for one thing, on your very last line, your "and" is being referenced as a visual basic keyword, and NOT a filter query.

rstRecordset.Filter = "Date='" & datefilter & "'" And "Name='" & namefilter & "'"

you never put and back in a string, something like:

rstRecordset.Filter = "Date='" & datefilter & "' And Name='" & namefilter & "'"

might be closer to what you are looking for ;) (the same principle about AND, being outside of the string, applies to the first query that doesn't work also)

Comatose 290 Taboo Programmer Team Colleague

I'm guessing this is basically the same project and problem you had with the Null error, please, try to keep each error problem that is similar in the same thread.

Comatose 290 Taboo Programmer Team Colleague

I like to debug with msgbox's, it stops the program at the point, and displays information too (such as the values contained within a variable). So, Whenever it is you are trying to read from the LDAP connection, stick a msgbox on it to very the contents being read in. Also, how are you going about connecting to, and reading fromt he LDAP connection? I'm guessing with Objects, but if you post the code, we can look through it.

Comatose 290 Taboo Programmer Team Colleague

Not that I know of.... You could consider using the open command, and running the script as a thread such as:

open (FH, "yourfile.pl -h");
close(FH);

You could also use the system command, but it would seem to me that shelling no matter how you do it is going to take a bit of processing time.

Comatose 290 Taboo Programmer Team Colleague

http://www1.cs.columbia.edu/~lennox/perlre.html is a great site to learn about regex's.... look up the "multi-line" regular expression test with the match operator. You'll be amazed at the power and versatility of it.

Comatose 290 Taboo Programmer Team Colleague

appreciate all the help we can get on this mrmike, but let's try to keep delphi in the delphi forum. Thanx.

Comatose 290 Taboo Programmer Team Colleague

I don't know if this answer, but I'm not seeing an if statement in there. Just an else, and an end if.

Comatose 290 Taboo Programmer Team Colleague

Indeed. If you need help with understanding POP3, and how to work with it in VB, I have written a tutorial:
http://www.daniweb.com/tutorials/tutorial20424.html, which is really helpful. It doesn't go as far as I'd like (it only allows you to click "check mail" and it tells you the number of messages, but I have built a more elaborate version for personal use, that displays a notification window near the system tray, to alert me of the number of messages, and I'm working on a spam filter for it), but you might find it helpful.

Comatose 290 Taboo Programmer Team Colleague

Why not code a server? It's not too difficult to do, I have even posted in a previous post a skeleton server that you can use, and it will simply creation of sockets and what not a whole lot. All you have to do is build the transactions between the server and client....

Comatose 290 Taboo Programmer Team Colleague

Hmn, I don't know if it matters a whole lot, but in your first selection string, you have single quotes ' ' around the { }=AV137, but in the sSelect variable, you don't have those.... I'm not sure it matters, but maybe sticking them around txtProgrammeNumber.text would work?

Comatose 290 Taboo Programmer Team Colleague

well, the only thing I can think that would be helpful would be to create a server app that sits on the computer.... then, when you connect, have the server send the client app any information that you would like, and process it accordingly....

Comatose 290 Taboo Programmer Team Colleague

I've found that most people have trouble with the update method. usually it seems to require some kind of disconnect and reconnect to the database to show changes, and when it does actually work, it's sporadic, and unpredicatable....

Comatose 290 Taboo Programmer Team Colleague

You want to read a databatrix barcode using VB?

Comatose 290 Taboo Programmer Team Colleague

Yes, Post Your code, so that we may see, and tinker with it.

Comatose 290 Taboo Programmer Team Colleague

Yes, Using the installer is the best way to go. I've found that the later versions don't seem to require a lot of command line working (in 98) for the install, but that's been my experience.

Comatose 290 Taboo Programmer Team Colleague

My MSI on 98 installed it without hardly any interaction at all, at c:\perl\bin\ (for the perl.exe and some other fun exe's that came with it).

Comatose 290 Taboo Programmer Team Colleague

You should be able to do a simple text like...

if form1.state = vbmaximized then
     ' /* Code For Maximized Form */
end if

However, vbmaximized MIGHT NOT be a constant, but numbers work, I believe 2 is maximized, but I could be mistaken. Also, The property might not be state, it might be style or something similar. So, Just test the property to find out if it's maximized or not.

As for adjusting the controls, you could do a loop of the control's collection, but you are going to be using a lot of comparisions to figure out the type of control you are working with. A Textbox doesn't have a caption property, for example, so you need to be aware of the differences involved with the properties of certain objects. I believe you can do a simple:

for each XCtrl in Controls
     msgbox XCtrl
next XCtrl

Then you could adjust them all with their properties in a simple for each loop. I hope this helps some.

Comatose 290 Taboo Programmer Team Colleague

Quite Possibly by using VBScript, Embeded into a VB6 application, you can simply map the drive.... this page gives you a pretty good idea as to use VBScript to map the drive:
http://visualbasic.ittoolbox.com/documents/document.asp?i=2938

Let me know what you come up with...

Comatose 290 Taboo Programmer Team Colleague

Just because microsoft abandon any and all help for it, does NOT mean that it's dead. Let's face it, there are still tons of corporations and businesses that use VB6 in order to build applications for themselves and for contract companies. Don't be fooled, VB6, while abandoned by it's creators, is still a fairly large beast....

Comatose 290 Taboo Programmer Team Colleague

in the form_resize event, you should be able to simple adjust the properties of the controls you want to mess with. For example, when the form gets resized (maximized) you can figure out the percentage and ratio, and use the .top, .left, .width and .height properties of any control:

command1.height = 5
command1.width = 10
command1.top = 0
command1.left = 0

For example..... let me know what you figure out.

Comatose 290 Taboo Programmer Team Colleague

K. The thing is, so long as you use <> it's probably going to block. Another alternative to consider (while I love your VB to Perl Idea... be forewarned that it would be easier to teach a cat to code ASM In Linux, than to make VB and Perl talk with sockets. I'm not saying it isn't possible, and I'm telling you I love the idea.... but it's not going to be the easiest thing you'll ever do). Another thing to consider is to replace <filehandle> with a sysread call in your while, and then read in 1 byte at a time. Everytime you read a byte, append it to buffer variable, that will contain the entire packet (byte for byte) until you reach the end of your packet (either by knowing the size in bytes, or by knowing a termination character). Then, once you have read in the entire packet, just pass it as a parameter to a sub that will analyze, and respond to the packet. This is where select would come in handy, because a while with sysread isn't going to block... if there is no data, it's just going to skip the while loop. Another alternative to that, is to do a while loop with 1

while (1) {
  # /* Do Socket Stuff */
}

And then just keep trying to read from the socket with your sysread call of 1 byte. If there is data in the socket, you will get that byte, …

Comatose 290 Taboo Programmer Team Colleague

You can add all kinds of great stuff in code modules too. You can have functions and subs accessible by the entire program, along with variables, constants, type declarations, and API calls. As soon as I start a new project, I add a code module (it's actually a standard module I built so that VB can use certain subs and functions that come in other language [such as push and pop]) right off the bat, so that I know I at least have one...

Comatose 290 Taboo Programmer Team Colleague

Yeah, Because I'm sure I can help you with any problem you have, but we need a little more information to go by.

Comatose 290 Taboo Programmer Team Colleague

I don't think so, but it's real easy to shell to the prompt, and mkdir -p that way, such as:

system "mkdir -p whatever";

or you can just use ticks `mkdir -p whatever`; Hope this helps.

Comatose 290 Taboo Programmer Team Colleague

Not to replace it so much, but you could just as easily do a pop and then an immediate push. So, something like:

$retval = pop(@arrayname);
push @arrayname, $newvalue;

so, $retval will contain the last item in the array, but the array will be one element less, and will not contain the last value any longer.... but $retval will. Then, you push the newvalue you want onto the array... this will essentially, remove the last element, and replace it with a new value...

Comatose 290 Taboo Programmer Team Colleague

You need to use the sendmessage API, and send an LB_ADDITEM to the hwnd of the listbox with the text to add to it. I'll cruft you up an example when I get my PC back and in good working condition :)

Comatose 290 Taboo Programmer Team Colleague

If you look in the tutorial's sections of this forum (VB tutorials) there is a tutoral I wrote on how to connect to a pop3 server using VB.... here is that link:
http://www.daniweb.com/tutorials/tutorial20424.html

Comatose 290 Taboo Programmer Team Colleague

A global variable has to be defined in a code module. A local variable gets dimensioned within the sub, and it's "scope" only extends within the sub. A Public Variable gets declared within the declarations section of the form, and it's scope is all procedures in the form. So, if you need a temporary variable, that only needs to be used in one procedure... use dim in that procedure. If you need a variable that the form can use... say, a variable that an OK and Cancel button can both have access to, then you would need a public/form-wide variable. If you want one that the entire project can use (spanning multiple forms) then you need a global variable (declared in a module).

Comatose 290 Taboo Programmer Team Colleague

*Nods*

jwshepherd is hitting real close to home with that. You should take his advice.

Comatose 290 Taboo Programmer Team Colleague

Mouse Events are not macro's. Mouse events are actual events that occur within VB when spawned by a specific action. If you are looking on how to fire those events programatically, you can look into sendkeys, or the sendmessage API.

Comatose 290 Taboo Programmer Team Colleague

What do you mean by INTO an EXE?

Comatose 290 Taboo Programmer Team Colleague

Or, Just a simple google search on vb6 class module example turns up quite a bit of good stuff. If you need, I can build one as an example, but there are tons of them out there with a google search.

Comatose 290 Taboo Programmer Team Colleague

That's definately the problem. That code, as far as I know, will only work on a mapped drive, or on the local machine. Sorry about that, I probably should have asked that before posting the code.

Comatose 290 Taboo Programmer Team Colleague

It's always hard when trying to do socket programming that's meant to be event driven, in a procedural fashion. I would personally suggest looking into modules that allow a Perl Application to Act more like it's event driven. Something along the lines of POE or Select. I realize that having built an app this far, having to take it back to the drawing board can be a pain, but that would be the best thing to do.

It would also seem to me, that the loop that you are running is blocking while waiting for data on the socket (The Parent Loop), so it should just sit there until there is data, but the problem is that <> waits for a termination character (\n), or a buffer size. You could also looking Poll, which will tell you if there is data waiting to be read. One thing I tinkered with, was changing $|, so that filehandles wouldn't buffer, but I had no such luck with it.... something maybe you want to dig into. Sorry I can't be of more assistance, but the best solution is to use POE or Select(). Good Luck, and please post the solution you come up with.

Comatose 290 Taboo Programmer Team Colleague

Do Me A Big Favor, And Define SAP?

Comatose 290 Taboo Programmer Team Colleague

what Operating System? Old school would seem old, windows 95 old?

Comatose 290 Taboo Programmer Team Colleague

;) leaning toothpick syndrome.... gotta love it

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

"Just Because You're Paranoid, Doesn't Mean That They Are Not Out To Get You"
;)

Comatose 290 Taboo Programmer Team Colleague

They are always there... Windows makes MRU's by default.... I've even built sample apps to read/edit/delete MRU Entries....

Comatose 290 Taboo Programmer Team Colleague

I don't exactly know what an RM Network is... but, If the File doesn't require installation, you can see if it will run .vbs files...

dim WSH
set WSH = createobject("WScript.Shell")
WSH.Run "c:\somepath\someprog.exe"

Does the system allow access to any programs at all?

Comatose 290 Taboo Programmer Team Colleague

Nice Work There.... Even Commented Some of the code :)

Comatose 290 Taboo Programmer Team Colleague

:) Thanx, I have my moments...

Comatose 290 Taboo Programmer Team Colleague

Is That A Good Thing, or a bad one?
Uh Oh, I'm being Monitored.... Quick, put away the big black VB book...