Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

data types

Posted on 2003-11-19
7
Medium Priority
?
224 Views
Last Modified: 2012-05-04
I am wanting to parse a text file,

the text file will be parsed into smaller 'blocks' of text and passed into another class.

What would be the best method of passing these blocks of text.

I know a 'string' is too small, is there something like a 'memo' that can hold more text?

Thanks,
Cassandra.
0
Comment
Question by:calebS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Accepted Solution

by:
TooKoolKris earned 160 total points
ID: 9783856
You can hold quite a bit of data in a string if you use an array. You could also split() the text on the "." so that each sentence would be an element of this array.
0
 
LVL 1

Author Comment

by:calebS
ID: 9783888
the file will look as below, with multiple (about 23) 'type' section (the type section being everything I have include except the first 3 lines). I want to pass the entire 'type' section into a class.

type(0).initialise(textBlock1)
type(1).initialise(textBlock2)
...
type(22).initialise(textBlock23)

I really want to pass it as an entire block.

Is it possible to pass reference to the start and end positions within the textfile itself?



//my data file below.
STYLE "Harvard"
STYLE_VERSION "1"
SOFTWARE_VERSION "1.0"

TYPE "Book"
    ADD _Title            (0, "Title:", LABELLEFT, 320, LABELWIDTH_LG, TEXTLEFT, 260, TEXTWIDTH_LG, "", True)
    ADD _AUTHOR            (1, "Author/s:", LABELLEFT, 620, LABELWIDTH_LG, TEXTLEFT, 560, TEXTWIDTH_LG, "Seperate additional authors with a colon (;)", True)
    ADD _Publisher      (2, "Publisher:", LABELLEFT, 920, LABELWIDTH_LG, TEXTLEFT, 860, TEXTWIDTH_LG, "", True)
    ADD _Location      (3, ElectronicLocation, LABELLEFT, 1220, LABELWIDTH_LG, TEXTLEFT, 1160, TEXTWIDTH_LG, "", True)
    ADD _Year            (4, "Year Published:", LABELLEFT, 1520, LABELWIDTH_LG, TEXTLEFT, 1460, TEXTWIDTH_SM, "", True)
    ADD _Page            (5, "Page Number:", LABELLEFT, 1820, LABELWIDTH_LG, TEXTLEFT, 1760, TEXTWIDTH_SM, "", True)
    ADD _Volume            (6, "Volume:", LABELMIDLEFT, 1820, LABELWIDTH_SM, TEXTMIDLEFT, 1760, TEXTWIDTH_SM, "", True)
    ADD _Accessed      (7, "Accessed:", LABELLEFT, 2120, LABELWIDTH_LG, TEXTLEFT, 2060, TEXTWIDTH_MED, "", EnableIfElectronic)

+TranslatedWork
      If _Translator "(Translated by ~_Translator~.)"
      If _ForeignLanguage "(Translated from ~_ForeignLanguage~ .)"
      If _ForeignLanguage/_Translator "(Translated from ~_ForeignLanguage~ by ~_Translator~.)"

+LimitedCirc
      If _LimitedCirc "(Available from ~_LimitedCirc~)"

+Abstract
      If _Abstract "(Abstract)"

+Revised
      If _Revised "~_Revised~ edition."

+Chapter
      If _Chapter "~_Chapter~ in"

+AuthorType
      If _Editor "(Editor)."
      If _Editor(multiple) "(Editors)."

DEFAULT_FILTER
<f>_Author<n> +AuthorType (_Year). +Chapter<i> _Title.<n> +Abstract +Revised +TranslatedWork _Location:_Publisher +LimitedCirc

FILTERS
If _ForeignTitle
<f>_Author<n> +AuthorType (_Year). +Chapter<i> _ForeignTitle <n>[_Title]. +Abstract +Revised +TranslatedWork _Location:_Publisher +LimitedCirc


0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 160 total points
ID: 9783970
Why do you think a String would be too small?

From the VB Help File: "A variable-length string can contain up to approximately 2 billion (2^31) characters."

A string would certainly hold one of your type sections, and probably your entire file.

Or...you could read the file one line at a time and the lines of text to a collection.  You could start a new collection one a new type section is encountered.  Then you can just pass the collection to your initialise() method.

Idle_Mind
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:calebS
ID: 9784097
thanks.

I actually didn't try.
I simply remember having major problems trying to use a large string some time ago.
Perhaps because I was using VBA in Word97.
I am sure it would only let me have 256 characters.

Thanks.
0
 
LVL 2

Expert Comment

by:CD-Softy
ID: 9785559
Hi,

Reference your sample data posted:
1. Is this what the whole file looks like?
2. Is each block seperated by a blank line?
3. If answer to (2) is no then how do you determine the start and end of a block?

If this is the case then I can help...

CD
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 9872515
Have you solved your problem yet?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question