November 23, 2009

A New Version of WinTask - 3.7

The good folks at TaskWare have released a new version of the favorite tool in my toolbox - WinTask.


There are two major new features in this release. 

First, WinTask 3.7 now supports Windows 7 and Windows Server 2008. 
And WinTask 3.7 includes the following FTP functions:

  • #FTPTimeout - Specifies the number of seconds which WinTask should wait before reporting a runtime error when it tries to execute a FTP function
  • FTPChDir - Specifies the new FTP current folder
  • FTPConnect - Makes a connection to the specified FTP server
  • FTPCurrentDir - Returns the FTP current folder
  • FTPDisconnect - Terminates the connection to a FTP server
  • FTPExistDir - Checks if the specified FTP folder exists or not
  • FTPExistFile - Checks if the specified FTP file exists or not
  • FTPGetFile - Downloads one or several files to the local PC from the FTP server
  • FTPKill - Deletes one or several files from the FTP server
  • FTPMkDir - Creates a folder on the FTP server
  • FTPName - Renames one or several files in the FTP server
  • FTPPutFile - Uploads one or several files from the local PC to a FTP folder
  • FTPRmDir - Deletes a folder and its contents on the FTP server
I'm particularly pleased with the new FTP functions. Our systems use FTP a lot - these new features will make it much easier to set up test conditions, and verify output.

Here are the release notes for version 3.7: http://www.wintask.com/hottest_new_version.php

Check this tool out at http://www.wintask.com/

You can see some of my WinTask utility scripts here, using the WinTask tag.

November 20, 2009

WinTask - DayOfDate$()


'
' DayOfDate$ - Return the day of the week for a given date
'
' Author - Joe Strazzere
'

Function DayOfDate$(TargetDate$)
    Local DayOfDate

    DayOfDate =((Weekday() + DateBetween("d",Date$(),TargetDate$)) mod 7)
    If DayOfDate < 1 then
        DayOfDate = DayOfDate + 7
    EndIf
    Select Case DayOfDate
        Case 1
            DayOfDate$ = "Sunday"
        Case 2
            DayOfDate$ = "Monday"
        Case 3
            DayOfDate$ = "Tuesday"
        Case 4
            DayOfDate$ = "Wednesday"
        Case 5
            DayOfDate$ = "Thursday"
        Case 6
            DayOfDate$ = "Friday"
        Case 7
            DayOfDate$ = "Saturday"
        Case Else
            DayOfDate$ = "I'm lost. I don't know what day "+Str$(DayOfDate)+" is."
        EndSelect
EndFunction

TargetDate$="11/21/2009"
TargetDay$=DayOfDate$(TargetDate$)
MsgBox(TargetDate$+" was a "+TargetDay$)

WinTask - DayOfDate()



'
' DayOfDate - Return the day number for a given date
'
' Author - Joe Strazzere
'

Function DayOfDate(TargetDate$)
    Local DayNumber
    DayNumber =((Weekday() + DateBetween("d",Date$(),TargetDate$)) mod 7)
    If DayNumber < 1 then
        DayOfDate = DayNumber + 7
    Else
        DayOfDate = DayNumber
    EndIf
EndFunction

TargetDate$="11/21/2009"
TargetDay=DayOfDate(TargetDate$)
MsgBox(TargetDate$+" was a "+Str$(TargetDay))

November 14, 2009

WinTask - ToDollarAndCent()


'
' ToDollarAndCent()
'
' Author: Joe Strazzere
'
' Removes all non-numerics from a string
' Returns two numbers
'    - the dollars portion
'    - the cents portion
'
Function ToDollarAndCent(test$,Dollars,Cents)
    Local i
    Local new$
    Local work$
    work$=""
    Dollars=-1
    Cents=0
    i=1
    While i<= len(test$)
        Select Case Mid$(test$,i,1)
            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
                new$=Mid$(test$,i,1)
            Case "."
                new$=""
                Dollars=Val(work$)
                work$=""
            Case Else
                new$=""
        EndSelect
        work$=work$+new$
        i=i+1
    Wend
    If Dollars=-1 Then
        Dollars=Val(work$)
    Else
        Cents=Val(Left$(work$,2))
    EndIf
EndFunction

ToDollarAndCent(" $123,456.789 ",D,C)
MsgBox(D)
MsgBox(C)

November 13, 2009

WinTask - ToNumber()


'
' ToNumber()
'
' Author: Joe Strazzere
'
' Removes all non-numerics from a string and returns a number
'
Function ToNumber(test$)
    Local i
    Local new$
    Local work$
    work$=""
    i=1
    While i<= len(test$)
        Select Case Mid$(test$,i,1)
            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
                new$=Mid$(test$,i,1)
            Case Else
                new$=""
        EndSelect
        work$=work$+new$
        i=i+1
    Wend
    ToNumber=Val(work$)
EndFunction
MsgBox(ToNumber("$123,456.78"))

WinTask - ToDollar()


'
' ToDollar()
'
' Author: Joe Strazzere
'
' Removes all non-numerics from a string and returns a number,
' stopping at the first decimal point.
'
Function ToDollar(test$)
    Local i
    Local new$
    Local work$
    work$=""
    i=1
    While i<= len(test$)
        Select Case Mid$(test$,i,1)
            Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
                new$=Mid$(test$,i,1)
            Case "."
                new$=""
                i=len(test$)
            Case Else
                new$=""
        EndSelect
        work$=work$+new$
        i=i+1
    Wend
    ToDollar=Val(work$)
EndFunction
MsgBox(ToDollar("$123,456.78"))

November 5, 2009

Test Data Graduates Into Production - WBZ

My good friend Dan Bourret recently heard that his son's school was being closed due to a high rate of illness among the teachers and students. Just to be sure, he checked the local television station's website and saw this:


Now, Dan also happens to be a terrific QAer, so he immediately recognized what happened - some test data had made its way into production. Oops!

We've all heard horror stories of test data gone astray, and this one seems rather benign.

Still, I'm wondering if there's actually a School Name A (Test) Elementary somewhere in Massachusetts that had an unanticipated day off?