From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,273f68be0dc28cef X-Google-Attributes: gid103376,public From: jm59@prism.gatech.edu (John M. Mills) Subject: Embedding Text Data in Source (Was Re: String to Integer) Date: 1997/07/17 Message-ID: <5ql62v$8dp@acmey.gatech.edu>#1/1 X-Deja-AN: 257417998 References: <5qglt7$cba$1@news.fsu.edu> Organization: Georgia Institute of Technology Newsgroups: comp.lang.ada Date: 1997-07-17T00:00:00+00:00 List-Id: I have a question which diverges slightly from the original topic, but is somewhat related. Please redirect me to "Read The Fine Manual" if that is appropriate, but be specific if you can. I now provide object parameters for a program in the form of a number of small files whose names are passed to the .Create(ParamFileName1, ...) procedures for each of the objects in my model. This works fine. I would also like to have a set of default parameters compiled into the code. Hard- coding this would be simple, but I want instead to include as the default a specified file from my source tree, verbatim, then use the same parsing routines to process either the file image embedded in the code or one read under a file name, as transparently as possible using approaches similar to the earlier suggestions in this thread: String'Value( ParamStr ) ... etc. The present form of my parameter files is similar to this: ! comment description VersionIDString ! string to match for error checking ! comment lines as desired RealValueString ! parameter value ! descriptive comment(s) IntegerValueString ! parameter value EnumValueString ! and so forth, with '*ValueString's in fixed order ... There is no guarantee that a line will have a specific length, but the sequence and grouping of parameters by [non-comment] line is well-defined. THE QUESTION: How can I embed those files' contents in my code automatically at compilation so they can be parsed as strings? Hope I managed to explain that .. &:^P I am using GNAT on a variety of UNIX platforms. Thanks -- john mills -- -- John M. Mills, Senior Research Engineer -- john.m.mills@gtri.gatech.edu Georgia Tech Research Institute, Georgia Tech, Atlanta, GA 30332-0834 Phone contacts: 404.894.0151 (voice), 404.894.6258 (FAX) "The 'Quick and Dirty' approach can generally be relied on to be dirty."-RlF