🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #393

Re: function StringOf

#393
From: Mike Copeland
Date: Sat, 26 Dec 1998 00:00
27 lines
1620 bytes
   First, you, the programmer, cannot create Pascal subprograms with 
variable numbers of parameters - only the compiler maker can do such 
things.  However, if you're looking to "construct" a string of substrings 
(such as your example shows), you can use the Concat function or the "+" 
operator.  For example:

Var S1,S2 : string;
...
  S2 := 'This is a substring.');
  S1 := 'Hello, '+'World! '+S2

> In another Pascal there was a function that I would like to recreate:
> 
> function StringOf ( ** SPECIAL ** ) : string;
> 
> The SPECIAL part was a parameter that was virtually identical to the
> parameter used by writeln(). That is to say that the following worked:
> 
> TheCostStr := stringof ('Cost of item ' , ItemNameStr , ' = ' ,
>  Price[ItemNumber] * Qty[ItemNumber] ) , '.');
> 
> Any idea how to create a function that would allow such a parameter ?
> 
> 
> 
> 
> 
Technical Details
Message-ID: <MPG.10ef42a8411e60b5989ad6@news.primenet.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <763sl2$v0@enews2.newsguy.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10261c,f9d88b35457e1f1d
X-Google-Attributes: gid10261c,public
X-Google-Thread: 111659,f9d88b35457e1f1d
X-Google-Attributes: gid111659,public
X-Google-Thread: 108ebd,f9d88b35457e1f1d
X-Google-Attributes: gid108ebd,public
From: mrcope@primenet.com (Mike Copeland)
Subject: Re: function StringOf
Date: 1998/12/26
Message-ID: <MPG.10ef42a8411e60b5989ad6@news.primenet.com>
X-Deja-AN: 426051821
References: <763sl2$v0@enews2.newsguy.com>
X-Complaints-To: abuse@globalcenter.net
Organization: Copeland Computer Services
X-Posted-By: @206.132.54.93 (mrcope)
Newsgroups: comp.lang.pascal.borland,borland.public.turbopascal,comp.lang.pascal.misc