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: Dale Stanbrough Subject: Re: 'first of strings returned from a function should be 1? Date: 1997/07/27 Message-ID: <5rg99c$pg1$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 259550786 Distribution: world References: <5rcaqi$le8$1@goanna.cs.rmit.edu.au> X-XXMessage-ID: Organization: Royal Melbourne Institute of Technology Newsgroups: comp.lang.ada Date: 1997-07-27T00:00:00+00:00 List-Id: Robert A Duff writes: "I don't get it. It sounds like you're willing to painstakingly calculate 387 characters, and then throw away all but one of them. But yet you begrudge the copying of them. What's the real-life example where this makes sense?" For my current situation it doesn't really matter much (i have written a function that selects a field from a colon (or whatever) separated list of fields in a string, and i am currently extracting a single character string), but the more general question came to mind. 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. Good point. Dale