![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Australia
Posts: 20
|
hello,
i have the following delphi code in relation to a null terminated string LibName, TransBuff : Pchar LibName = StrAlloc (500) Transbuff = StrAlloc (970) could someone please tell me the relative vba code for variable type Pchar and function StrAlloc? regards |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Unless you find someone here who knows Delphi, you will need to give an indepth description of what that code is doing before you can get a decent answer.
Explain the type Vchar Also the function StrAlloc Thanks, Tom |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Apr 2002
Location: Vancouver BC , Canada
Posts: 6,259
|
So it's not only me that didn't understand what he was talking about !
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Location: Australia
Posts: 20
|
hi there Tom,
Pchar is an ANSI (8 bit) character. StrAlloc allocates a buffer for a null-terminated string and returns a pointer to its first character. Rgds |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
The only 8 bit data type in VB is the byte data type. This will only return a number from 0 to 255.
I do not know what a null terminated string is, so I cannot really help you there. You may need to find someone who knows both languages. Tom |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
I don't know if this helps, but, VBA has some constants:
vbNullString vbNullChar there's another one that may be what you want vbNull |
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi vvershas,
I only know a little about Delphi. The character sequence type "String" used by Delphi is original with Delphi. A StrAlloc function secures a memory. So I GUESS only you have to do it with vba is Dim LibName As String * 500 Dim Transbuff As String * 970 May be.....but I think that I do not need to carry out such usage by VBA. |
|
|
|
|
|
#8 |
|
New Member
Join Date: Apr 2002
Location: Australia
Posts: 20
|
hi Colo,
that code has worked fine thanks! it does appear that Vb doesn't need specific code to do this. cheers Microsoft 1 Borland 0 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|