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,5c1c45943bf6a5bc X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: 'first of strings returned from a function should be 1? Date: 1997/07/27 Message-ID: #1/1 X-Deja-AN: 259576600 Distribution: world References: <5rcaqi$le8$1@goanna.cs.rmit.edu.au> <5rg99c$pg1$1@goanna.cs.rmit.edu.au> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-07-27T00:00:00+00:00 List-Id: In article <5rg99c$pg1$1@goanna.cs.rmit.edu.au>, Dale Stanbrough wrote: >If I selected a field, and wanted to check whether a substring existed... > > if Index (Field (Line, 2, ':'), "xxx") = 0 then > >Copying the string (yet again) just to pass it to another function didn't >seem to make sense. Perhaps I could also write Field as a procedure returning >an upper and lower bound to eliminate all copying. I don't know what you mean either, by "copying the string just to pass it to another function." If Field is a function that returns a string, and you pass it as an argument to another subprogram, on what basis are you assuming a copy occurs? Strings (and other arrays and records) are usually passed by reference. What's different about your problem? -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271