Stumped by a Syntax Error
From: U-CDK_CHARLES\\Charles (_at_aol.com)
Date: 11/22/04
- Next message: Paul Clement: "Re: VB 6 or VB.NET"
- Previous message: Rick Rothstein: "Re: help on text box"
- Next in thread: U-CDK_CHARLES\\Charles: "Re: Stumped by a Syntax Error"
- Reply: U-CDK_CHARLES\\Charles: "Re: Stumped by a Syntax Error"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Nov 2004 20:25:32 GMT
I've two similar snippets of code, one of which compiles, and one which
does not.
On the second snippet, when the set method is entered, it fails to
compile because of a "missing list separator"
The compiling and non compiling code are similar, as are the methods. I
cannot think of a reason why one would compile and the other not.
Does anyone know what I've botched in my set line method?
Thanks
Charles
The first snippet works correctly:
Private Sub importApprovals(importReq As CRequisition)
Dim selectionRow As New CSubsetRow
selectionRow.addColumn "Owner", importReq.ReqId
Dim reqLineList As CList
Set reqLineList = DataAccessor.read("Export_Approvals", _
, selectionRow)
Dim iter As IIterator
Set iter = reqLineList.iterator
Dim currRow As CRow
Dim ItemNumber As Integer
Dim currApproval As CApproval
Do Until iter.IsDone
Set currRow = iter.CurrentItem
ItemNumber = currRow.getColumnValue("Ordinal")
Set currApproval = importReq.Approval(ItemNumber)
currApproval.setFromRow currRow
Set importReq.Approval(ItemNumber) = currApproval
Set currRow = Nothing
iter.NextItem
Loop
Set iter = Nothing
Set reqLineList = Nothing
End Sub
the second snippet does not compile:
Private Sub importReqLines(importReq As CRequisition)
Dim selectionRow As New CSubsetRow
selectionRow.addColumn "Owner", importReq.ReqId
Dim reqLineList As CList
Set reqLineList = DataAccessor.read("Export_ReqLines", _
, selectionRow)
Dim iter As IIterator
Set iter = reqLineList.iterator
Dim currRow As CRow
Dim ItemNumber As Integer
Dim currReqLine As CRequisitionLine
Do Until iter.IsDone
Set currRow = iter.CurrentItem
ItemNumber = currRow.getColumnValue("[Item Number]")
Set currReqLine = importReq.line(ItemNumber)
currReqLine.setFromRow currRow
Set importReq.line(ItemNumber) = currReqLine
' This line gets "Expected: List separator" at
' the parenthesis following "ItemNumber"
Set currReqLine = Nothing
Set currRow = Nothing
iter.NextItem
Loop
Set iter = Nothing
Set reqLineList = Nothing
End Sub
The methods being invoked:
Public Property Get Approval(idx As Integer) As CApproval
If idx > maxApprovals - 1 Then
Err.Raise vbObjectError + 5
End If
Set Approval = mApprovals(idx)
End Property
Public Property Set Approval(idx As Integer, vlu As CApproval)
Dim i As Integer
If idx >= maxApprovals Then
Err.Raise vbObjectError + 5
End If
Set mApprovals(idx) = vlu
' (some stuff snipped that doesn't matter)
mLastUpdate = Now
mLastUpdatedBy = currentUser.UserLogin
mSent = False
End Property
Public Property Set line(idx As Integer, vlu As CRequisitionLine)
If idx < 0 Or idx > mNumLines Then
Err.Raise vbObjectError + 9
End If
Set mLines(idx) = Nothing
Set mLines(idx) = vlu
Me.Status = REQ_STATUS_OPEN_CHANGED
mSent = False
End Property
Public Property Get line(idx As Integer) As CRequisitionLine
If idx < 0 Or idx > mNumLines Then
Err.Raise vbObjectError + 9
End If
Set line = mLines(idx)
End Property
- Next message: Paul Clement: "Re: VB 6 or VB.NET"
- Previous message: Rick Rothstein: "Re: help on text box"
- Next in thread: U-CDK_CHARLES\\Charles: "Re: Stumped by a Syntax Error"
- Reply: U-CDK_CHARLES\\Charles: "Re: Stumped by a Syntax Error"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|