Solved

Array is to long

Posted on 2001-06-13
15
250 Views
Last Modified: 2011-10-03
How do I break a Array?
I have a big number of line-continuation characters needed, need tobreak the construct into more than one statement for continuenci.

Thanks


Call moData.Execute("ins_MyContact", "", QO_UseStoredProc, _
                        Array("@UserID", adInteger, 4, CInt(varUserID)), _
                        Array("@ContactID", adInteger, 4, CInt(varContactID)), _
                        Array("@FirstName", adChar, 45, ParamField(varFirstName, False)), _
                        Array("@LastName", adChar, 45, ParamField(varLastName, False)), _
                        Array("@Phone", adChar, 30, ParamField(varPhone, False)), _
                        Array("@Fax", adChar, 30, ParamField(varFax, False)), _
                        Array("@Mobile", adChar, 30, ParamField(varMobile, False)), _
                        Array("@Pager", adChar, 30, ParamField(varPager, False)), _
                        Array("@Email", adVarChar, 100, ParamField(varEmail, False)), _
                        Array("@Address", adVarChar, 80, ParamField(varAddress, False)), _
                        Array("@City", adChar, 45, ParamField(varCity, False)), _
                        Array("@State", adChar, 45, ParamField(varState, False)), _
                        Array("@Zip", adChar, 15, ParamField(varZip, False)), _
                        Array("@Country", adChar, 45, ParamField(varCountry, False)), _
                        Array("@Title", adChar, 65, ParamField(varTitle, False)), _
                        Array("@BusinessName", adChar, 65, ParamField(varBusinessName, False)), _
                        Array("@BusAddress", adVarChar, 80, ParamField(varBusAddress, False)), _
                        Array("@BusPhone", adChar, 30, ParamField(varBusPhone, False)), _
                        Array("@BusCity", adChar, 45, ParamField(varBusCity, False)), _
                        Array("@BusState", adChar, 45, ParamField(varBusState, False)), _
                        Array("@BusZip", adChar, 15, ParamField(varBusZip, False)), _
                        Array("@BusCountry", adChar, 45, ParamField(varBusCountry, False)), _
                        Array("@Comment", adVarChar, 250, ParamField(varComment, False)), _
                        Array("@Category", adChar, 8, ParamField(varCategory, False)),
0
Comment
Question by:msilva
  • 6
  • 3
  • 3
  • +2
15 Comments
 
LVL 28

Expert Comment

by:AzraSound
Comment Utility
every parameter needs to be an array?  what happens when you run the above?  perhaps i dont understand what you are trying to do...
0
 

Author Comment

by:msilva
Comment Utility
I have 5 more parameters to add to this aray as I try to do that, I get a error from VB "Too many line continuations". So I'm not able to add any mor parameter to this array.
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
That is because of the _
sign to break into a new line. -- You'll need to have alot on one line; there are limitations with the IDE.
0
 
LVL 11

Expert Comment

by:ASPGuru
Comment Utility
i'm not sure... is this what you want?

instead of:
    Array("@UserID", adInteger, 4, CInt(varUserID)), _
    Array("@ContactID", adInteger, 4, CInt(varContactID)), _
    Array("@FirstName", adChar, 45, ParamField(varFirstName, False)), _
    ....
    ....

use this:


    Array("@UserID", adInteger, 4, CInt(varUserID), _
          "@ContactID", adInteger, 4, CInt(varContactID), _
          "@FirstName", adChar, 45, ParamField(varFirstName, False), _
           ....
           ....
0
 

Author Comment

by:msilva
Comment Utility
I can not have in different line or the next funcion will not be able to parce the array. Also doing this:
Array("@UserID", adInteger, 4, CInt(varUserID), _
         "@ContactID", adInteger, 4, CInt(varContactID), _
         "@FirstName", adChar, 45, ParamField(varFirstName, False), _
         
Will give me the same error.
0
 
LVL 15

Expert Comment

by:robbert
Comment Utility
It has nothing to do with arrays. It's just that you can't combine too many lines within a function call.
0
 
LVL 11

Expert Comment

by:ASPGuru
Comment Utility
why does the last line end in a ","?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:msilva
Comment Utility
The last end in comma because I can not add any more line.
0
 
LVL 15

Expert Comment

by:ameba
Comment Utility
:-) Maybe his editor is limited to 80 characters per line, and he cannot put 2 Array statements on one line.

msilva, don't use fortran editor  ;-)
0
 
LVL 11

Expert Comment

by:ASPGuru
Comment Utility
i still don't understand what the problem is... i don't see any array that is to long...

anyway, do you know tha you can call a SP with the command object, which allows you to assign the paramters line by line before you actually call execute...
0
 
LVL 15

Accepted Solution

by:
ameba earned 50 total points
Comment Utility
msilva wrote: > I get a error from VB "Too many line continuations".

Sample how to reduce number of line continuations from 4 to 1:

x = Array(lalla), _
 Array(lalla), _
 Array(lalla), _
 Array(lalla), _
 Array(lalla)

x = Array(lalla), Array(lalla), Array(lalla), _
 Array(lalla), Array(lalla)

see also robbert's posts.
0
 

Author Comment

by:msilva
Comment Utility
I did try that by was not as well construct as yours.
0
 

Author Comment

by:msilva
Comment Utility
I did try that by was not as well construct as yours.
0
 
LVL 15

Expert Comment

by:ameba
Comment Utility
Thanks. Credits go to robbert.
0
 

Author Comment

by:msilva
Comment Utility
Yes your are correct, Robbert made a very usufull commemt.
Is not a array issue but a combination of too many lines.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now