Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Array is to long

Posted on 2001-06-13
15
Medium Priority
?
295 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
ID: 6188246
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
ID: 6188307
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
ID: 6188323
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 11

Expert Comment

by:ASPGuru
ID: 6188334
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
ID: 6188394
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
ID: 6188409
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
ID: 6188523
why does the last line end in a ","?
0
 

Author Comment

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

Expert Comment

by:ameba
ID: 6188682
:-) 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
ID: 6188688
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 200 total points
ID: 6188723
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
ID: 6188764
I did try that by was not as well construct as yours.
0
 

Author Comment

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

Expert Comment

by:ameba
ID: 6188889
Thanks. Credits go to robbert.
0
 

Author Comment

by:msilva
ID: 6188926
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 informatio…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

885 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