Page 1 of 2

Error "e is already declared

Posted: Thu Jan 02, 2014 12:09 pm
by hungryhounduk
Hi All

I was just doing a Decrypter App from a Tutorial, In the Tutorial i have 2 subs with the same strings and I am getting an error on the Letter e, as It's already Declared?

Dim a, b, c, d, e,(This is the Error) f, g, h, i, j, k, l , m, n, o, p, q, r, s, t, v, w, x, y, z As String
Dim outcome As String

a = "a"
b = "b"
c = "c"
d = "d"
e = "e"


Can some kind Soul point me in the right direction to sort the ERROR out

Cheers

Chris

ps/// I have encluded the Source below, so if someone could just take a look, as you might be able to just sort it with a little knowhow.......

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 12:25 pm
by noypikami
make sure that those letters has not something in common on its value when encrypted.

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 12:31 pm
by Dummy1912
if your sub contains a 'e' already then you can't use the e again
like for example

private sub demo (byval e as ....)
so if you use here the e from your dim then you get 'e It's already Declared'

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 12:41 pm
by visualtech
that depends if this code is inside a Click Handler (or any other "Sub" with the "Handles" clause); the reason being that: It is a standard EventArgument variable for .NET

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 12:45 pm
by hungryhounduk
I have posted up the source in the first post, can someone take a look at it, it will be an easy fix for someone who knows what they are doing :)

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 1:07 pm
by Dummy1912
you have 2x e in your code
please try to change the dim e with e1 for example


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a, b, c, d, e, f, g


this cause the error :)

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 1:11 pm
by hungryhounduk
Hi Dummy
ok i will try that :)

Thanks

Chris

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 1:17 pm
by hungryhounduk
Ok I tried that with a e1 and an e2, but still an error

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 1:23 pm
by Dummy1912
i didn't get any errors i run it build
works fine without errors

Re: Error "e is already declared

Posted: Thu Jan 02, 2014 1:26 pm
by noypikami
dummy is right.. just change the "e". i just tested it and its working...

you may try mine too, i made this long time ago.
you will have alot of ideas from this.
it works the same likes yours, and the code is much shorter.
source code and exe are encluded in a zip file.


This file is hosted off-site.