Solved

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

Posted on 1998-11-13
2
2,429 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 50 total points
Comment Utility
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
Comment Utility
var st:string;char_in:char;
begin st[1]:=char_in;end;

??!??!??
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now