From: z80eu@arcor.de   
      
   winston19842005 schrieb:   
   > On 1/19/09 3:40 PM, in article   
   > 4974e538$0$31331$9b4e6d93@newsspool4.arcor-online.net, "Peter Dassow"   
   > wrote:   
   >   
   >> Help wanted...   
   >>   
   >> Have a string function in TP 4.0:   
   >>   
   >> FUNCTION UprCase(s: String): String;   
   >>   
   >> VAR   
   >> i: Integer;   
   >>   
   >> BEGIN   
   >> FOR i := 1 TO Length(s) DO   
   >> IF s[i] IN ['a'..'z'] THEN   
   >> s[i] := UpCase(s[i]);   
   >>   
   >> UprCase := s;   
   >> END;   
   >>   
   >> But this does not work with TP 3.0 ... Identifier expected, because   
   >> functions can't obviously contain a "string" variable in parameter list   
   >> - that's a limit in TP 3.0 and I do not know how to bypass it.   
   >> Array [n..m] of char is also not accepted inside the function parameter   
   >> list.   
   >> So how can I to this in TP 3.0 except using global variables instead of   
   >> function parameter ?   
   >>   
   >> Yes, I know, long ago... but unfortunately I have to use TP 3.0 :-(   
   >   
   > Of course Array [n..m] isn't accepted in a function parameter.   
   > You need to use TYPEs...   
   >   
   > type Str= array[n..m] of char;   
   >   
   > function UprCase(s: Str): Str;   
   >   
   >   
   Thank you.   
   Meanwhile I did it already, I used   
    type String_tp3 = string[128];   
   and I replaced String with String_tp3 ...   
      
   Unfortunately a new problem occurs:   
      
   TP 3 does not anything about a forward declaration of a function.   
   So if there are 3 functions like a(d), b(e) and c(f),   
   and a(d) uses b(e) inside, and b(e) uses c(f) inside,   
   but c(f) uses also a(c) inside, that's Catch22 if you can't use forward   
   declaration.   
      
   Regards   
    Peter   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|