Apps, dlls, or ActiveX Components with LARGE amts of internal data 
Author Message
 Apps, dlls, or ActiveX Components with LARGE amts of internal data

I have an application that includes a quite large (35,000 entries)
read-only array  packed with pre-existing data. For various reasons I
want the contents of this array to load with the application, not to be
read in from a file. Basically this is a knowledge-based system and I
need the knowledgebase included with the system.)

Using LISP, I would simply read the data in from a file or from a
database *at compile time*, and save a compiled image that includes the
data-filled array. I don't see how to do anything like this in VB5.0.

I DON'T want to use an external database, for reasons of both security
and speed (I've tried it).

I would be willing (indeed eager) to build the array into a dll or an
ActiveX component/control, but don't see how to do this either.

Any help or pointers would be appreciated.

-- Les Gasser



Sun, 26 Dec 1999 03:00:00 GMT  
 Apps, dlls, or ActiveX Components with LARGE amts of internal data


Quote:
> I have an application that includes a quite large (35,000 entries)
> read-only array  packed with pre-existing data. For various reasons I
> want the contents of this array to load with the application, not to be
> read in from a file. Basically this is a knowledge-based system and I
> need the knowledgebase included with the system.)

> Using LISP, I would simply read the data in from a file or from a
> database *at compile time*, and save a compiled image that includes the
> data-filled array. I don't see how to do anything like this in VB5.0.

You can't do this in VB. I understand you have a private file-based
database that you don't want to distribute. So, if you want to compile your
array in your exe (or dll or ocx) file you have to:
1. load the array from your database in memory.
2. save it to a text file (you can use the RichTextBox) with the format
recognized by VB. Example:
say the array you save data in is called MyArray(1 to 32000) as string.
Fill in the array with your data.

Example:

    Dim MyArray(1 To 32000) As String

    Dim ln As String
    Dim i&
    Dim t As Integer
    Dim DoubleQuote As String

    DoubleQuote = Chr$(34)      'Character "
    t = FreeFile

    'Fill in your array
    MyArray(1) = "Line 1"
    MyArray(2) = "Line 2"
    MyArray(3) = "Line 3"

    'Open file
    Open "Include.bas" For Output As t

    'print your array to a sequential file
    For i& = 1 To 3
        'Omit Doublequote unless your data are strings
        ln = "MyArray(" & LTrim$(Str$(i&)) & ") = " & DoubleQuote &
MyArray(i&) & DoubleQuote
        Print #t, ln
    Next i&

    Close t

now you have a file .bas with the following format:

MyArray(1) = "Line 1"
MyArray(2) = "Line 2"
MyArray(3) = "Line 3"

and so on.

Now you just have to include the created .bas file to your project and
compile.



Mon, 27 Dec 1999 03:00:00 GMT  
 Apps, dlls, or ActiveX Components with LARGE amts of internal data


Quote:
> I have an application that includes a quite large (35,000 entries)
> read-only array  packed with pre-existing data. For various reasons I
> want the contents of this array to load with the application, not to be
> read in from a file. Basically this is a knowledge-based system and I
> need the knowledgebase included with the system.)

> Using LISP, I would simply read the data in from a file or from a
> database *at compile time*, and save a compiled image that includes the
> data-filled array. I don't see how to do anything like this in VB5.0.

You can't do this in VB. I understand you have a private file-based
database that you don't want to distribute. So, if you want to compile your
array in your exe (or dll or ocx) file you have to:
1. load the array from your database in memory.
2. save it to a text file (you can use the RichTextBox) with the format
recognized by VB. Example:
say the array you save data in is called MyArray(1 to 35000) as Long. Fill
in the array with your data.

example:

    Dim MyArray(1 To 32000) As String

    Dim ln As String
    Dim i&
    Dim t As Integer
    Dim DoubleQuote As String

    DoubleQuote = Chr$(34)      'Character "
    t = FreeFile

    'Fill in your array
    MyArray(1) = "Line 1"
    MyArray(2) = "Line 2"
    MyArray(3) = "Line 3"

    'Open file
    Open "Include.bas" For Output As t

    'print your array to a sequential file
    For i& = 1 To 3
        'Omit Doublequote unless your data are strings
        ln = "MyArray(" & LTrim$(Str$(i&)) & ") = " & DoubleQuote &
MyArray(i&) & DoubleQuote
        Print #t, ln
    Next i&

    Close t

now you have a file Include.bas with the following format:
MyArray(1) = "Line1"
MyArray(2) = "Line2"
and so on

Just add Include.bas to your project and compile.

Hope this helps.

Domenico Statuto



Mon, 27 Dec 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Apps, dlls, or ActiveX Components with LARGE amts of internal data

2. Apps, dlls, or ActiveX Components with LARGE amts of internal data

3. VB6 Internal DLL Variable can not be set to external activex control in IE

4. Can ActiveX DLL component contain ActiveX control?

5. Passing data to an internal form within a DLL

6. the best way to read large amount of data from a MTS component

7. the best way to read large amount of data from a MTS component

8. Data transfer from ASP app to ActiveX app

9. ActiveX DLL calling DLL procedures from ASP app...

10. Automating internal hyperlinking in large documents

11. Is there any problem with using a large number of ActiveX DLLs

12. How to keep ActiveX EXE component alive without client apps

 

 
Powered by phpBB® Forum Software