Re: count_string program

From: Cecilia Chew (cecilia_at_nowhere.com)
Date: 02/27/04


Date: Fri, 27 Feb 2004 11:19:20 +0800

Björn Persson wrote:
> Cecilia Chew wrote:
>
>> Hi all,
>> I am doing a program that will count the input characters from user.
>> There is a problem that I can't solve.
>> Problem is : since I'm going to count the characters. So, I can't ask
>> user how many characters they want to input. Compilation error come
>> and mention that the string need to be constrainted.
>> How am I going to constraint the string type since I don't know how
>> many characters user going to input.
>
>
> If you do want to store the characters, and not just count them, then
> you obviously need a data type that can handle a variable number of
> characters. The first place to look for a suitable data type is Ada's
> standard library.
>

Since user will enter more than one characters, is that any problem if i
placed the type string is array (positive range <>) of character; to
handle a variable number of characters?
As input is declared as type string, isn't the characters will be stored
as the Get (input(i)); being executed??

-- 
Cecilia Chew
c e c i l i a <AT> g r e e n l i m e . c o m


Relevant Pages

  • RE: Automatic Preceeding Zeros in a field e.g. 00001234
    ... > user having to input the zeros. ... If your objective is to always have 8 characters in the table, then it should be type String. ... Dim str as String ...
    (microsoft.public.access.tablesdbdesign)
  • Simple question for yous......
    ... Hey gurus, ... If, say, I have a URL (or any "path" type string come to think of it), how ... to use it as a path, I just want to truncate it from display purposes. ... ".../" for those bits of the path that make it go over 50 characters. ...
    (comp.lang.perl.misc)
  • Re: No. of datatypes
    ... The best place to get all the data type will be SQl serevr Books online. ... Variable-length non-Unicode data with a maximum of 8,000 characters. ... Variable-length binary data with a maximum length of 8,000 bytes. ...
    (microsoft.public.sqlserver.programming)
  • Re: Reading GIF
    ... around that lets the programmer deal with a data type that Fortran ... signed integers than as characters. ... In theory, a compiler might not ... support 8-bit signed integers either, ...
    (comp.lang.fortran)
  • Re: Parameter query not working correct.
    ... If Text, be aware that the matching may be affected by invisible formatting characters, such as spaces, embedded carriage returns, or null characters. ... If you are still stuck after that, post the SQL statement, indicate the data type and size of these 2 fields, and the specific values that fail. ... pull along with the loan number and load ID. ...
    (microsoft.public.access.queries)