473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
4 1643
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
Here is the function ArraySearch: '-------------------------------------------------------------------------------------- 'ArraySearch will return an integer value indicating the first...
2
by: Andreas Müller | last post by:
Hi all, VB.NET has the "Redim " statement, which allows me to redimension a System.Array to a new size. I was wondering if something like that is build into the C# language, too? Thanks in...
10
by: Andreas Müller | last post by:
Hi all, I have a class SwitchCursor, that implements IDisposable. Is it legal to use an object that is not assigned to a reference inside a using statement like this: using(new...
5
by: charliewest | last post by:
I've implemented the USING statement to ensure that my newly created sql connection closes when my method is finished using it. The USING statement is wrapped in try/catch error handling statement....
1
by: tm | last post by:
I have created an array as follows: Public pPrintList() as String How can I test it to see if it has been initialized with an element (ReDim pPrintList(12) ) with out causing...
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
4
by: darrell | last post by:
I recently wrote a program in Access VBA that contains this snippet of code: For i = 1 to TotalBanks With Me("txtBank" & Chr(i + 64)) .BackColor = vbBlue .ForeColor = vbWhite End With Next i...
0
by: mantrid | last post by:
I was thinking along these lines initially but didnt know much about arrays. So thought the easiest way was to use two separate fields. However the two fields match, in that the commar separated...
21
by: Mike N. | last post by:
Can someone tell me if there is a C# equivelent to the VBA 'with' statement that works like this: Set myControl = CommandBars(PopUpToUse).Controls.Add(msoControlButton, before:=5) With...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.