Public fixed length string variable

K

Ken

I am generating a fixed length text file from my Excel 2003 data for
import into an accounting system. I have it working okay by padding
the cells with spaces and trimming appropriately before stringing the
cell values together for export. I was hoping to simplify my process
with a class module with properly lengthed string variables; but, I
don't seem to be able to declare fixed length string variable as
Public. I have a POHeader class module and i want to have e.g.

public PO_ID As String * 10

I can use Dim PO_ID As String * 10 in my regular module and it works;
but if I use that in the POHeader class module I can't get to it from
the regular module. Is this a limitation of class modules or am I
overlooking something or does anyone have any other ideas?

Thanks

Ken
 
P

Peter T

There are various things that can't be declared as public in class/object
modules, and a fixed length string is one of them.

A simple workaround is to declare as private and use a [public] property
let/get pair to access it.

Regards,
Peter T
 
K

Ken

Thanks Peter, I will look into that approach.
Ken

There are various things that can't be declared as public in class/object
modules, and a fixed length string is one of them.

A simple workaround is to declare as private and use a [public] property
let/get pair to access it.

Regards,
Peter T




I am generating a fixed length text file from my Excel 2003 data for
import into an accounting system.  I have it working okay by padding
the cells with spaces and trimming appropriately before stringing the
cell values together for export.  I was hoping to simplify my process
with a class module with properly lengthed string variables; but, I
don't seem to be able to declare fixed length string variable as
Public.  I have a POHeader class module and i want to have e.g.
public PO_ID As String * 10
I can use Dim PO_ID As String * 10 in my regular module and it works;
but if I use that in the POHeader class module I can't get to it from
the regular module.  Is this a limitation of class modules or am I
overlooking something or does anyone have any other ideas?

Ken- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top