declaration is too long

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

Sorry for my silly question. I need to declare may variable as string.
1st line dim x,y,a,_
2nd line b,c,d as string
(it seems syntax error, Please be kind to correct me)
 
Hi,
Leave a space between ',' and '_' on the 1st line as in

Dim x,y,a, _
b,c,d as string

Sorry for my silly question. I need to declare may variable as string.
1st line dim x,y,a,_
2nd line b,c,d as string
(it seems syntax error, Please be kind to correct me)
 
Agnes,
I would suggest:
1st line dim x,y,a As String
2nd line Dim b,c,d as string

However I normally use:

Dim x As string
Dim y as string
Dim a as string
Dim b as string
Dim c as string
Dim d as string

With that many variables, I would look at what the routine was really doing
and refactor (http://www.refactoring.com) so I did not need so many string
variables. Such as using an Array instead.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top