Solved

Array is to long

Posted on 2001-06-13
15
263 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 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