Click to See Complete Forum and Search --> : Another VB Question


xaviorg
04-24-2003, 03:55 PM
in VB6, is there a way to make an array with no defined subscripts? example: dim array as string, NOT dim array(0 to 5) as string? just wondering if you can declare an array that has no definate limit

PeOfEo
04-25-2003, 07:10 AM
I dont think you can use varent anymore, I get an error saying it was changed to object the other day

PeOfEo
04-25-2003, 07:52 PM
vb does yes, but when I tried to use a varient in one of my asp.net applications it game me a nice little error saying that the varient object is no longer used and it has been changed to object or something.

PeOfEo
04-26-2003, 05:11 PM
vb does support a varient, like actual vb, but when i tried it for asp.net i got an error

PeOfEo
04-27-2003, 08:26 PM
sub something or other ()
dim x,y,z as varient
if something = something then
something
end if end sub

thats what something would look like in vb the actual application visual basic. But when I type out that same code in asp.net, It would give me an error saying, varients is no longer supported, it has been changed to object. It must be reading my code as vb.net or something but I have script language = vb at the top of my page.

PeOfEo
04-28-2003, 07:10 AM
this is vb script though, I am saying in actual vb, on the net, you cannot make something a varient, it will give you an error, atleast it did for me. I have not needed varient much fortunatly, I have been able to stick to integer and to string.

khaki
05-01-2003, 07:28 AM
this is vb script though, I am saying in actual vb, on the net hey Peo...
are you yanking Dave's chain?!

he keeps saying the same thing to you and you keep arguing a point that is making no sense.

is your code "on the net"?
if yes... it's essentially vbscript
if no... it's either vb or vba

Dave has explained it perfectly: VB supports any of these (among others):

Dim var1 As String
Dim var2 As Integer
Dim var3 As Variant

VBScript, on the other hand, cannot specify the As clause at all. All variables in VBScript are of the type Variant. ... so why the argument?

:confused: k

khaki
05-01-2003, 08:48 AM
I had already decided to not reply anymore. oh :eek: oops!
sorry i broke the silence :rolleyes:

Peo wrote: I have not needed varient much fortunatly, I have been able to stick to integer and to string.
in vbscript VARIANT is ALL types of variables (including String and Integer).
NO variable can be specified in vbscript AT ALL...
so you have NOT been getting-by with defining only String and Integer.

if you put any vb-type code on an asp page, it will be treated as vbscript...and since vbscript does not have explicit data types... ANY attempt to specify one will result in an error.

and just for the record...
xaviorg's question concerned VB6...
not ASP.Net

VARIANT is alive and well in VB (and VBA).
(and it is assumed in vbscript)

but this brings-up a point of curiousity for me:

Does ASP.NET have it's own vb-derivative...
or does it use conventional vbscript?
(hmmm.... maybe this question would be better-off in a different thread :rolleyes: )

Does anybody know?
;) k

khaki
05-01-2003, 09:20 AM
I actually researched it myself and found that ASP.NET uses VB.Net.

But now my question is...
is there anybody out there who hard-codes in VB.Net?
(like in Notepad or something)?

Is VB.Net pretty-much created by WYSIWYG from within ASP.NET?

Is it an XML/vbscript hybrid (something like the way MS Word or Excel creates those outlandish pages of incomprehenible source-code)?

I should probably look into what ASP.NET is all about...
but I haven't felt that I was needing anything that I wasn't already getting by creating my own ASP pages.
:confused:

one more thing...
does anyone think that ASP.NET is going to spawn a crop of WYSIWYG ASP developers...
or is it actually a "proffessional" tool for those who like to work within the code itself?

any knowledgable feedback would be appreciated...
;) k

EDIT:
I found this link which explains how VB.Net declares variables.
Live and learn :rolleyes:
http://visualbasic.about.com/library/bldykvardima.htm