VB Error: Array Names are Ambiguous - What Now?

  • Thread starter Thread starter zanazzi78
  • Start date Start date
  • Tags Tags
    Array Error
AI Thread Summary
The discussion revolves around a programming issue related to Visual Basic (VB) where the user encounters an "ambiguous name detected" error when defining an array. The user has defined an array as spd(n,n) but is unsure why VB is flagging it as ambiguous. Key points include the importance of explicitly defining all variables when using 'Option Explicit', which requires that every variable has a specified type. It is suggested that the user needs to declare 'n' as an integer using 'Dim n as integer' to avoid ambiguity. Additionally, it's noted that arrays can only be dimensioned with fixed values or constants, and if dynamic sizing is needed, the 'ReDim' function should be considered. The error may also arise if there are other variables, functions, or subs with the same name as the array being defined.
zanazzi78
Messages
115
Reaction score
1
To those who helped yesterday,again, thanks.

I have managed to resolve most of my problems, however, i have a new issue.

VB seemsto think that the names of my arrays are "ambiguous", WHY?

what do i need to do to resolve this new and fustrating problem?
 
Technology news on Phys.org
Can you elaborate?
 
In the optionexplict i`ve defined my array as spd(n,n)

Vb doesn`t like this and i don`t know why!
 
zanazzi78 said:
In the optionexplict i`ve defined my array as spd(n,n)
Vb doesn`t like this and i don`t know why!
Have you defined n?

'Option Explicit' means you must explictly define every variable with a type. If you merely say a(n,n) that's not explicit.

You first need 'Dim n as integer'.
 
Typically you can only dimension an array to either values (i.e. 4) or constants. If you have n defined as dim n as integer, it will (in my experience) kick the variable out. If you need to have it change size look at the redim function. Hope this helps
 
An "ambiguous name detected" error is caused by a sub, function, or some other variable or array having the same name as the one you are currently trying to define.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Back
Top