Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Array is to long

Posted on 2001-06-13
15
Medium Priority
?
289 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
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…

730 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