| 1. |
Solve : Quality control or Validation for a commandline entry? |
|
Answer» here's a vbscript. i've seen some code where they use a "timestamp" to create a name... you have any ideas?? Some of this might be useful... Quote @echo off Quote today is 25/07/2007 and the time now is 18:19:16.71 The XP system time variable %time% has a resolution of 1/100th of a second which ought to guarantee fairly unique timestamps. If there is a danger of duplication you could add a delay by eg pinging a nonexistent ip address with a 5 (approx) millisecond timeout Quote echo %time% Quote 18:38:23.23 Contrex, Thanks again for your help on this project. The testers found two errors. I tried to fix them but I'm having trouble. Error 1: for some weird reason, the program accepts 22233355& as a valid nine digit, numbers only entry. or any other 8 digit + the "&".... all other 8 digit + other symbol entry is rejected (22233355*, 22233355!, etc) Error 2: the program is supposed to zip all the files with the same SSN into one zip file, and the user can zip up to five SSN which then gets zipped into a master zip file... the error the testers found is that if the user attempts to zip the same SSN into one bundle, I increase the count, even though, the number of SSNs does not increase.... basically, i need a way to keep track of the SSNs in the program... is there a source where i can get some quick basics on the power of DOS programming... i'm more familiar with more structured programming languages, with arrays and stuff.. ok, i fix error two.... with a little thought, i figured out to move the zipped files to a separate directory, then if it exist, do not count or zip again... doh! sometimes you can't see the forrest for the trees.. i'm still perplexed by error number 1.... i know & and * are wild cards in DOS, but why is & considered a valid number but * is not?? The ampersand, "&" is what is called a "poison character". It breaks code that works with all others. I am working on a solution. Are you allowed to use a DOS executable? I can easily write a compiled app in FreeBASIC which can be called from a batch file and which would receive user input and check for ANY non-numeric character. The FreeBASIC COMPILER is free and I can give the source code and links to the compiler and IDE so you can modify it and experiment. FreeBASIC is like QBasic in syntax, but it is not a 1980s product. contrex, thanks for all your help..... i appreciate your offer of a different solution, but I don't want to go down that road, yet.... i ask the the user to put in an SSN, and we catch 99.9 percent of the possible errors, so if they put in an ampersand, they deserve what they get.... (what are the odds that someone is gonna hold down the Shift key, let alone the Shift key and the number 7) if you can point me to a link that shows that & is a "poison character", i can probably justify the program we have Quote from: cornbread on August 02, 2007, 11:27:56 AM if you can point me to a link that shows that & is a "poison character", i can probably justify the program we have Well, the first few of these ought to do it... http://www.google.co.uk/search?source=ig&hl=en&q=ampersand+poison+character&btnG=Google+Search&meta= let me know if you want more/others perfect.... thanks (i owe you part of my pay!!) if its any consolation, the work i'm doing (with your help), is for disable militaryQuote from: cornbread on August 02, 2007, 12:26:10 PM if its any consolation, the work i'm doing (with your help), is for disable military Glad to help. some more http://www.google.co.uk/search?num=100&hl=en&safe=off&q=batch+poison+characters&btnG=Search&meta= |
|