home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,720 of 2,978   
   winston19842005 to z80eu@arcor.de   
   Re: Help ! Downgrade from Turbo Pascal 4   
   19 Jan 09 16:18:09   
   
   From: bjjlyates@NOSPAMbellsouth.net   
      
   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;   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca