null terminated string

vvershas

New Member
Joined
Apr 6, 2002
Messages
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
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,484
Messages
6,113,927
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top