Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Incompatible types: 'Char' and 'String'??

Posted on 1998-11-13
2
Medium Priority
?
2,790 Views
Last Modified: 2012-06-21
I have a function that needs a single letter passed to it(Char). This letter is the first letter in a string from another component. How do I convert the first letter of a string into the type Char?

Thanks
0
Comment
Question by:Kmiller
2 Comments
 
LVL 5

Accepted Solution

by:
scrapdog earned 200 total points
ID: 1346722
Given:

var s :string[50];  {or any size string}
    c :char;


c := s[1];  

will transfer the first letter of string s into char c.  Pass c (the char) to the function.
0
 
LVL 1

Expert Comment

by:jecksom
ID: 1346723
var st:string;char_in:char;
begin st[1]:=char_in;end;

??!??!??
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question