Re: File List Box



These are called 'type declaration characters' and are a holdover from prior
versions of basic. As such, not all data types in VB have type declaration
characters:

Boolean none

Byte none

Currency @

Date none

Decimal none

Double #

Integer %

Long &

Object none

Single !

String $

Variant none



So, Dim s as String, and Dim s$ are the same. Ditto Dim c as Currency and
Dim c@.

This is also why, in API programming where you want to pass a null (0) value
to an API, you often see it written as 0& (to force the 0 to be representing
as a long as opposed to an integer).

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.




"WebBiz" <justask@xxxxxxxxxxxxxxxxx> wrote in message
news:3RLzg.14641$PO.12931@xxxxxxxxxxxxx

"J French" <erewhon@xxxxxxxxxx> wrote in message
news:44cf475f.1027836519@xxxxxxxxxxxxxxxxxxxxxxx
On Tue, 1 Aug 2006 06:59:52 -0500, "WebBiz"
<justask@xxxxxxxxxxxxxxxxx> wrote:

I notice that you use the $ a lot. This reminds me of the old basic if
memory serves me. Have yet to run across what all those shortcuts mean in
any book. Recommend a resource that covers those odd looking variables?

To me $ is not an odd looking variable

It is the oldest BASIC definition of a String

It is extremely significant in things like Left$() versus Left()

We have had this discussed a number of times ...



It's unfortunate that my newsreader does not let me search historical
postings. (Outlook Express)

:-(
Rick


.



Relevant Pages

  • Re: Concencate Emails, Error type declaration does not match
    ... but I'm getting an error "Type Declaration does not match declared data ... Dim rs As DAO.Recordset ... Dim ToVar As String ...
    (microsoft.public.access.formscoding)
  • Re: File List Box
    ... out on this in that these are Type Declaration shortcuts. ... So, Dim s as String, and Dim s$ are the same. ...
    (comp.lang.basic.visual.misc)
  • Concencate Emails, Error type declaration does not match
    ... but I'm getting an error "Type Declaration does not match declared data type" ... Dim rs As DAO.Recordset ... Dim ToVar As String ...
    (microsoft.public.access.formscoding)
  • Re: Dim + the sign &
    ... characters are not as widely understood as the $ sign for currency (even by ... I know they are type declaration ... in declaring a iValue as a integer and a sValue as a string I ... to an int if doing so in the dim iValue as String ...
    (microsoft.public.vb.general.discussion)
  • Re: architectures with their own "config PCMCIA"
    ... > string value further into other types isn't worth the trouble. ... > at hand is easy enough to solve by adding a type declaration. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)

Loading