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: mheaney@ni.net (Matthew Heaney) Subject: Re: Embedding Text Data in Source (Was Re: String to Integer) Date: 1997/07/19 Message-ID: #1/1 X-Deja-AN: 257812051 References: <5qglt7$cba$1@news.fsu.edu> <5ql62v$8dp@acmey.gatech.edu> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-07-19T00:00:00+00:00 List-Id: In article <5ql62v$8dp@acmey.gatech.edu>, jm59@prism.gatech.edu (John M. Mills) wrote: >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. I'm not sure exactly what you're trying to do, but here's a suggestion. Can't you use a function call that returns a string as your default value? ie function Default_Value return String; procedure P (O : T := Default_Value); and then the Default_Value function could parse a file, read an environment variable, etc. The function gets invoked at run-time, and only then if the call of P doesn't have an explicit value as an argument. Of course, if it's the same value every time it's invoked (it only changes across program executions), then you can calculate that value once at initialization, either via an explicit package initialization subprogram or implicitly via package elaboration (be careful of the latter). Is this in the ballpark of what you wish to do? -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271