Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6820249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:24:09+00:00 2026-05-26T21:24:09+00:00

What generic type should i use, if I have to assign a Character value

  • 0

What generic type should i use, if I have to assign a Character value to it?
For now I’m using type Char is(<>); at the generic declaration,
and assign the character value like this:

XY:GenericChar;
CharacterVariable: Character:='A';

XY:=GenericChar'Value(Character'Image(CharacterVariable));

It works, but i think there should be a better way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:24:09+00:00Added an answer on May 26, 2026 at 9:24 pm

    You could use 'Pos and 'Val.

    Converting between non-related enumeration types is non-trivial. Best would be to use a conversion function like:

    generic
       type Generic_Char is (<>);
       with function To_Generic_Char (Source : Character) return Generic_Char is <>;
    package Foo is
    ...
    

    That way your generic package wouldn’t have to care about converting.

    For instantiating the package you would have to create the function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a generic class that should allow any type, primitive or otherwise. The
I have generic type that looks like: public class GenericClass<T, U> where T :
I'd like to get the generic type of a collection, using reflection, at runtime.
I am using SimpleJdbcTemplate and for example I have something like this: @Override public
I have a class that has a Generic type G In my class model
Is it possible to reflectively instantiate a generic type in Java? Using the technique
I have a generics class, that uses TBase as the type parameter. Using MEF,
If have a type hierarchy that starts out with a generic type class A<T>
Imagine C# code like this ISomeInterface someVar = creator.Create(typeof(SomeClass), typeof(ISomeInterface)); What should happen? Method
I have a Interface Foo which has a generic type - public interface Foo<T>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.