Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Asterisk after String Delcaration????

I just came across some string variable declarations that I have not seen
before and was wondering if someone could explain what they mean. I have
never seen the asterisk used before like this. Is this a VBA thing? Lastly
does it translate into VB.Net?

Dim strBuffer()As String * 1

and then within a
Private Type udtWIN32_FIND_DATA
cFileName As String * 260
cAlternat As String * 14
End Type

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default Asterisk after String Delcaration????

Hi Rick
Just to illuminate this further, can you see where such a construct would be
used? It is so rare to see in my experience.

Thanks

--

Regards,
Nigel




"Rick Rothstein" wrote in message
...
That is how you declare a fixed length string. For example, this..

Dim strVar As String * 10

declares strVar as a String variable that always has 10 characters... the
string is always padded (if necessary) with blank spaces to ensure the
variable contains 10 characters. However, if the variable has not yet been
initialized (that is, nothing has ever been assigned to it), then it is
defaulted to a string composed of 10 characters with an ASCII value of
0... but once something has been assigned to the variable, it will (from
then on) be blank space padded even if the empty string is assigned to it
later on. So, if you did this...

strVar = "ABCDE"

then strVar would equal those characters with 5 blanks spaces after them.
If you then later on did this...

strVar = ""

then strVar would contain 10 blank spaces. The example you gave of this...

Dim strBuffer()As String * 1

declares a dynamic array of Strings that will be made up of elements that
are all one character long.

--
Rick (MVP - Excel)


"Excel Monkey" wrote in message
...
I just came across some string variable declarations that I have not seen
before and was wondering if someone could explain what they mean. I have
never seen the asterisk used before like this. Is this a VBA thing?
Lastly
does it translate into VB.Net?

Dim strBuffer()As String * 1

and then within a
Private Type udtWIN32_FIND_DATA
cFileName As String * 260
cAlternat As String * 14
End Type

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Asterisk after String Delcaration???? Rick Rothstein Excel Programming 0 April 28th 09 04:48 AM
Asterisk after String Delcaration???? Jacob Skaria Excel Programming 0 April 28th 09 04:41 AM
Asterisk geminitwin Excel Worksheet Functions 4 August 23rd 08 06:20 PM
asterisk tikchye_oldLearner57 Excel Discussion (Misc queries) 7 January 26th 07 01:43 AM
Finding an asterisk Blah Excel Discussion (Misc queries) 4 May 20th 06 02:36 AM


All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"