|
Posted by Glenn Adams [MVP - Retail Mgmt on June 8, 2005, 12:23 pm
Please log in for more thread options Everytime your function runs, you are re-declaring the weightcount variable.
Declare the variable outside of the function (where TimerID is)
--
Glenn Adams
Tiber Creek Consulting
http://www.tibercreek.com glenn@tibercreek.com
----------------------------------------------
Please DO NOT respond to me directly but post all responses here in the
newsgroup so that all can share the information
> For some reason, once I use one weight item (Item Type 6), it loses
> track of things... I've tried it at various points of the IF loops for
> status.htm
>
> Any thoughts?
>
>
> Dim TimerID
>
>
> ' ------------------------------------
> ' displayVariables
> ' ------------------------------------
>
> Function displayVariables
> On Error Resume Next
>
> Dim QSRules
> Dim Entry
> Dim TransasctionItem
> Dim txtItemLookupCode
> Dim txtDescription
> Dim txtPrice
> Dim txtQuantity
> Dim txtExtended
> Dim PictureFileName
> Dim PictureFileName2
> Dim txtPictureextension
> Dim weightcount
>
> Dim RS
> Dim SQL
> Dim Conn
>
> Set QSRules = qsBridge.RequestQSRules()
>
> txtDescription = " "
> txtQuantity = " "
> txtPrice = " "
> txtExtended = " "
> txtPicture = ""
> txtPicture2 = ""
> txtPictureextension = ".jpg"
> SQL = ""
>
> Set RS = Nothing
>
> Set Entry = Nothing
> Set TransactionItem = Nothing
> PictureFileName = "transparent.gif"
> PictureFileName2 = "transparent.gif"
>
> If Not QSRules Is Nothing Then
>
> ' This line is valid after version 1.07
> Set Entry =
> QSRules.Transaction.Entries(QSRules.Transaction.CurrentEntryKey)
>
> If Entry Is Nothing then
> Set Entry =
> QSRules.Transaction.Entries(QSRules.Transaction.Entries.Count)
> End If
> '**************************************************
> 'PROBLEM CODE'
> If Entry.Item.Itemtype = 6 Then
> weightcount = weightcount + 1
> 'weightcount = Entry.Item.Weight - (Entry.Item.Weight - 1)
> End If
> '***************************************************
> If Not Entry Is Nothing Then
> txtDescription = Entry.Description
> txtQuantity = Entry.Quantity
> txtPrice = FormatCurrency(Entry.Price)
> txtExtended = FormatCurrency(Entry.ExtendedPrice)
>
>
> SQL = "SELECT PictureName FROM Item WHERE ItemLookupCode = '"
> + Entry.Item.ItemLookupcode + "'"
> Set Rs = QSRules.OpenRecordSet((SQL),(-1))
> If Not Rs.EOF Then
> PictureFileName = Rs("PictureName")
> if (len(PictureFileName) < 1) then PictureFileName =
> "transparent.gif"
> Else
> PictureFileName = "transparent.gif"
> End If
> End If
> End If
>
>
>
>
> PictureFileName2 = Entry.Item.ItemLookupcode & txtPictureextension
>
> Picture.src = "C:Program FilesMicrosoft Retail Management
> SystemStore OperationsPictures" & PictureFileName
> Picture2.src = "C:Program FilesMicrosoft Retail Management
> SystemStore OperationsPictures" & PictureFileName2
>
> 'txtTotalQuantityPurchased.innerText =
> QSRules.Transaction.TotalQuantityPurchased +
> QSRules.Transaction.TotalQuantityOnOrder
> txtTotalQuantityPurchased.innerText =
> QSRules.Transaction.TotalQuantityPurchased +
> QSRules.Transaction.TotalQuantityOnOrder -
> QSRules.Transaction.TotalWeightPurchased + weightcount
> End Function
>
> Function doStartup
>
> ' use a timer to run displayVariables() periodically every second
> TimerID = window.setInterval("displayVariables()", 100)
>
> End Function
>
|