Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Asterisk after String Delcaration????
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Asterisk after String Delcaration???? | Excel Programming | |||
Asterisk | Excel Worksheet Functions | |||
Repeating Asterisk | Excel Worksheet Functions | |||
asterisk | Excel Discussion (Misc queries) | |||
asterisk in a cell | Excel Discussion (Misc queries) |