By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,630 Members | 1,537 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,630 IT Pros & Developers. It's quick & easy.

redim in a web service with arrayed structors/"Redim statement requires Array"

P: n/a
I am having trouble with ReDim (see code below)

SaleTable2's structure includes an array for SaleDetailTable2
Dim newsale As New hallsales.SaleTable2
Dim detail As New hallsales.SaleDetailTable2

Try

redim newsale.SaleDetails(0) ********* This line comes out with an error
"Redim statement requires Array" *************

newsale.SaleDetails(0) = detail

a = obj.SellFromPOS(newsale, bcomplete)

Catch ex As Exception

End Try

Is there a way through or around this problem?

Daryl Davis
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I should mention that the structures are pulled from a VB6 dll.
Daryl
"Daryl Davis" <th***********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I am having trouble with ReDim (see code below)

SaleTable2's structure includes an array for SaleDetailTable2
Dim newsale As New hallsales.SaleTable2
Dim detail As New hallsales.SaleDetailTable2

Try

redim newsale.SaleDetails(0) ********* This line comes out with an error
"Redim statement requires Array" *************

newsale.SaleDetails(0) = detail

a = obj.SellFromPOS(newsale, bcomplete)

Catch ex As Exception

End Try

Is there a way through or around this problem?

Daryl Davis

Nov 20 '05 #2

P: n/a
Cor
Hi Daryl,

As soon as you needs redim, you can better look at the arraylist.
The array is not efficient.

My advice have a look at what the "arraylist" can do for you first.
And if it there something you do not understand, ask it in this thread
again.

I hope this helps,

Cor
I am having trouble with ReDim (see code below)

Nov 20 '05 #3

P: n/a
Cor,
I don't think the arraylist will help me. Let me try to explain myself
again, for last night I was extreemly fustrated....
I have vb6 dlls already built and running. I am going to try to access
these dlls through a websevice so that I can access them from remote units
(CE.net). All this webservice is new to me so please bear with me, I am
learning it as fast as I can.
The following Types are in the vb6 dll.

Public Type SaleDetailTable
ProductID As Long
ProductQty As Integer
ProductAmt As Single
TaxableItem As Integer
PointsUsed As Integer
DiscountAmt As Single
ProductCharge As Single
IsElecBingo As Boolean
End Type

Public Type SaleTable
SaleID As Long
ticketnumber As Long
acctticket As Long
SellDate As Date
SessionDate As Date
Session As Integer
posStation As Integer
UserID As Long
CreditAmt As Single
ProductAmt As Single
TaxAmt As Single
DiscountAmt As Single
PointsUsed As Integer
PointsEarned As Integer
MemberID As Long
voided As Integer
SaleClosed As Integer
SaleFinalized As Integer
SaleDetails() As SaleDetailTable
End Type

Simple enough, I can access the web service via the smartdevice. (thanks
to other peoples newsgroups postings I was able to figure this out)
Now as you see at the end of the SaleTable Type, SaleDetails is an array. I
belive that I am recieving a nullexception error when I call my web service
because of this... Or I may be in the completly wrong ballpark. The redim
line is (example as I am still doing some trial and error)

redim newsale.SaleDetails(4)

The call is simple
a = obj.SellFromPOS(newsale, bcomplete)

where a is an integer return, newsale is a SaleTable, and bcomplete is the
return on if the sale was completed.

The dll is supposed to change ticketnumber from 0 to a 9 diget number.

I hope that this clears up my explanation.
Daryl

"Cor" <no*@non.com> wrote in message
news:OD**************@tk2msftngp13.phx.gbl...
Hi Daryl,

As soon as you needs redim, you can better look at the arraylist.
The array is not efficient.

My advice have a look at what the "arraylist" can do for you first.
And if it there something you do not understand, ask it in this thread
again.

I hope this helps,

Cor
I am having trouble with ReDim (see code below)


Nov 20 '05 #4

P: n/a
I have figured this out.
The only way it seems that I am able to make these changes is if I create a
structure exactly like the vb Type and set it equal
newsale.saledetail = webservicecopy.saledetail

Thank you for your help...
Daryl

"Cor" <no*@non.com> wrote in message
news:OD**************@tk2msftngp13.phx.gbl...
Hi Daryl,

As soon as you needs redim, you can better look at the arraylist.
The array is not efficient.

My advice have a look at what the "arraylist" can do for you first.
And if it there something you do not understand, ask it in this thread
again.

I hope this helps,

Cor
I am having trouble with ReDim (see code below)


Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.