|
Answer» I'm gonna apologize for terminology errors right now - I've been an RPG/COBOL programmer all my life. This is my 1st excursion into PC programming.
I'm on a project to get an electronic signature done on a Topaz Device up to the iSeries as a *PAGSEG. I've got all the pieces working and am now trying to incorporate a .bat file into my VB app instead of doing TWO separate remote calls from the iSeries to the PC. The VB app gets a signature from the Topaz device and writes it as a .tif file. It was created in Visual Basic 2008 Express. It's running on Windows XP. The .bat file converts the .tif file created by the VB app to the correct format and FTPs it to the iSeries. I put Shell("C:\batfile.bat") into my VB script after my WriteImageFile("C:\signature.tif") command. It works, but is always transferring the signature done on the prior execution of the VB app instead of the current execution of the VB app. It's behaving as though the .tif file isn't being put to DISK until the VB app ends. I know how to solve this on the iSeries so believe there must be some way to solve it on the PC. I'm hoping it's as simple as overriding some system value as the VB app runs. Can someone please offer a suggestion? Thanks everyone.Corry, I have been a PL/1 programmer all my life and found the same type VB symptoms. For example: I found that if you want to Draw a Bitmap to a Picture Box and then do some "other" things after that, is seems to do the "other" things first, and finally Draws the Bitmap into the Picture Box. I found also that VB seems to do the same for writing a Picture or Bitmap to an output file as the last THING. VB will do things in the right order, but just seems to complete that Drawing or Writing as the final thing within a Do Loop or Function or Procedure. You could monitor this behaviour by inserting Beeps and Debug.Writeline.
I have no suggestions how to solve that problem. It is one of those things you have to get used to. This wound seem to be a problem of DELAYED execution. The programmer must insert some code that ensures that process B does not start until process A is done. One method is to check for the pretense of and old object, delete it, the create a new object. Then verify the new object is present before going on to some thing else. Thanks Geek-9pm. I guess that means PCs don't have a "force write ratio" attirbute equivalent. Given that, what you suggest makes a lot of sense. Since my VB education and knowledge is limited can you give me an idea what the code would look like, or help me understand what to search for on the internet that would give me some kind of an example to play with? Rather than to attempt doing the code for you I am giving you a link. In a simple case all you need to do is just give a close command for the flie. But real life is not always simple. You may be in a database environment where you have limited ability to close the file. Notice the problem these guys had. (Has some VB code.) http://www.tek-tips.com/viewthread.cfm?qid=1365082&page=10Your link gives me thoughts on other possible alternatives and things to research that might help. I think I need to read it again for it all to soak in. If my HEAD doesn't explode by Monday from all the extra PC stuff I'll let you know if I've been able to mkae it work and what I've done. Again - thanks a lot. :-)Yeah, if you are doing SQL or anything like that, it gets kinda heavy.
|