Solved

Array is to long

Posted on 2001-06-13
15
269 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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 50 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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