Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How many characters is 64K

3,847 views
Skip to first unread message

Brett Slattery

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
Matt,

Enter 64000 in the textbox's MaxLen property. Or, if you have an input mask,
do it programmatically with the following code:

(Place the following code in the keypress method of the textbox.)
Lparameters nKeyCode, nShiftAltCtrl
If len(this.value)> 64000
Wait window nowait "Character Limited Exceeded"
This.value= left(this.value,64000)
Endif
--
Brett Slattery
Slat...@ewol.com


"Matt" <Ma...@hotmailx.nospam.com> wrote in message
news:#Bk7ZB00$GA.267@cppssbbsa04...
> I'm a newbie to programming and I have to limit a editbox so it won't
exceed
> 64K.


Brett Slattery

unread,
Jun 12, 2000, 3:00:00 AM6/12/00
to
Hi Hugo,

I learn something new form this newsgroup every day. What is a 2 byte word?
What is unicode?

I'm under the impression that every language, including Fox, evaluates just
one byte at a time. But I'd appreciate any information to the contrary. The
exceptions to the norm are what keep us busy!

--
Brett Slattery
Slat...@ewol.com


"Hugo M. Ranea" <hmr...@usa.net> wrote in message
news:3945ADCE...@usa.net...
> What about 2 byte words, unicode, etc? Aren't those factor alter the 64K
> limit?


Hugo M. Ranea

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Mike, Brett

What about 2 byte words, unicode, etc? Aren't those factor alter the 64K
limit?

I must confess that I've never used them, so I'm probably wrong.

Hugo

Hugo M. Ranea

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Hi Brett

Well, as I said, I've never used them, when I saw this post, I thougth
of Unicode, that I believe is stored in two bytes. Then in the Foxpro
Help I found that there are also 2 bytes chars (no words as I said,
sorry) to support some languages with funny names I've never heard
before. For information on Unicode you can read www.unicode.org, from
where I'd extraced the following:

-----------
The Unicode Worldwide Character Standard is a character coding system
designed to support the interchange, processing, and display of the
written texts of the diverse languages of the modern world. In addition,
it supports classical and historical texts of many written languages.
VERSION 3.0

The most current version of the Unicode standard contains 49,194
distinct coded characters. These characters cover the principal written
languages of the Americas, Europe, the Middle East, Africa, India, Asia,
and the Pacific Basin. Certain technical reports are approved and part
of 3.0. For a list, see the Technical Reports page.
------------

Furthermore, the VFP help estates (Probably wrong word) that all the
limits that are expressed in chars should be considered as 1 byte chars,
and must be converted in case you use the other charsets.

I hope someone with experience working with this can give as some
enlighting (I'me sure is not the right word)

Bye
Hugo


Brett Slattery wrote:
>
> Hi Hugo,
>
> I learn something new form this newsgroup every day. What is a 2 byte word?
> What is unicode?
>
> I'm under the impression that every language, including Fox, evaluates just
> one byte at a time. But I'd appreciate any information to the contrary. The
> exceptions to the norm are what keep us busy!
>
> --
> Brett Slattery
> Slat...@ewol.com
>
> "Hugo M. Ranea" <hmr...@usa.net> wrote in message
> news:3945ADCE...@usa.net...

MAppell917

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Hugo,

In short, no they don't.

You are mixing apples and oranges. K always refers to bytes, not words, bits,
nibbles or anything else.

If you want the long winded lecture, I'm about to start rambling......Actually,
all of this terminology goes right back to assembly and machine language along
with semantics and binary. At the hardware level, everything is in binary (ie:
on/off) which is really at base 2. Since a number in base 2 is really not
enough to represent much they have combined 8 of them (8 bits and sometimes an
extra one for parity but forget about that for now). One of them (on/off) you
may know is called a bit. 4 of them (some of you may know) is called a nibble
(well at least it used to be unless they have changed it). 8 as most people
know is called a byte. (In fact, it's also where the hexadecimal system comes
into play, base 16). That's really important because 2^8 is 256 and represents
the possible combinations for one byte (8 bits) which in many computers each
number is assigned a symbol in the ASCII (American Standard Code for
Information Interchange) system. In fact, that's how the functions ASC() and
CHR() allow us to convert and utilize ASCII.

Anyways, I know I'm rambling a bit (no pun intended). But, we have at the most
fundamental level, a bit. 8 of them make a byte. When you say a computer has
one megabyte you are saying it has one million bytes actually 2^20 bytes.

Words (at least as far as I can recall) are actually 2 bytes or double words
are 4 bytes. I think that may have come much later when the original 8080 or
8088 microprocessor came along. The CPU had the ability to do operations on
"Words" or 2 bytes at a time. Words are useful for performing arithmetic
operations (on a low level) along with utilizing them for accessing memory
addresses. Many microprocessors before the 8088 could deal with Words but
they were not nearly has flexible and the term was not invented (although some
may have used the term doublebyte).

Okay, if I haven't put you to sleep yet, I hope that helps.


>Subject: Re: How many characters is 64K
>From: "Hugo M. Ranea" hmr...@usa.net
>Date: 6/12/00 8:46 PM Pacific Daylight Time
>Message-id: <3945ADCE...@usa.net>
>
>Mike, Brett


>
>What about 2 byte words, unicode, etc? Aren't those factor alter the 64K
>limit?

>I must confess that I've never used them, so I'm probably wrong.
>
>Hugo
>


Mike

MAppell917

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Brett,

2 bytes is a word. Double word is 4 bytes. All this stuff refers to 8088,
286, etc. assembly language programming. I haven't done it in a while but I
remember.

I don't think it matters much at all in VFP though.


>Subject: Re: How many characters is 64K

>From: "Brett Slattery" slat...@ewol.com
>Date: 6/12/00 8:54 PM Pacific Daylight Time
>Message-id: <OXXQgsO1$GA....@cppssbbsa02.microsoft.com>


>
>Hi Hugo,
>
>I learn something new form this newsgroup every day. What is a 2 byte word?
>


Mike

MAppell917

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Whoops. The term may have been used on minicomputers and mainframes (not sure,
maybe there are some IBM 360/370 assembly language programmers out there. They
may have used the term Words it's just been too long).

Definitely not used on micros before the 8088 or 68000 though.

>addresses. Many microprocessors before the 8088 could deal with Words but
>they were not nearly has flexible and the term was not invented (although
>some
>may have used the term doublebyte).
>


Mike

Hugo

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Here it is the extract I first read when I post my first message, is in the
VFP Help, so I think it matters. I know I make a mistake and said double
byte words instead of characters.

*---------------------------------------------------------------------------
------------------------------------------
STRCONV( ) Function
See Also

Converts character expressions between single-byte, double-byte, UNICODE,
and locale-specific representations.

Syntax

STRCONV(cExpression, nConversionSetting [, nLocaleID])

Returns

Character

Arguments

cExpression

Specifies the character expression that STRCONV( ) converts.

nConversionSetting

Specifies the type of conversion. The following table lists the values of
nConversionSetting and the type of conversion performed.

nConversionSetting Conversion
1 Converts single-byte characters in cExpression to double-byte characters.
2 Converts double-byte characters in cExpression to single-byte characters.
3 Converts double-byte Katakana characters in cExpression to double-byte
Hiragana characters.
4 Converts double-byte Hiragana characters in cExpression to double-byte
Katakana characters.
5 Converts double-byte characters to UNICODE (wide characters).
6 Converts UNICODE (wide characters) to double-byte characters.
7 Converts cExpression to locale-specific lowercase.
8 Converts cExpression to locale-specific uppercase.


nLocaleID

Specifies the Locale ID to use for the conversion. If nLocaleID is invalid
or not supported on the machine, the error "Invalid locale ID" is generated.
If nLocaleID is omitted, the system locale ID is used by default.

Remarks

This function is useful for manipulating double-byte character sets for
languages such as Hiragana and Katakana.
*----------------------------------------------------------

This second extract (also from VFP) is more interesting yet:

*-----------------------------------------------------------
Using DBCS Characters When Naming Objects
Visual FoxPro allows you to use DBCS characters when naming elements of your
applications. As with Visual FoxPro generally, elements can:

Be up to 254 characters in length with the combination of double-byte
characters and single characters. For example, if you use all double-byte
characters, the name you're creating can be only 127 characters long.
Begin with a letter, number, underscore or leading-trailing byte
combination.
Contain only letters, numbers, underscores, or DBCS characters.
These rules apply to variables, objects (windows, menus, and so on),
function and procedure names, class and subclass names, aliases, and
constants. You can also use double-byte characters for file names. To avoid
the possibility that characters in the file name are inadvertently treated
as delimiters, it's safest to always enclose the file name in quotation
marks.

Note Visual FoxPro length limits are expressed using single-byte
characters. Using double-byte characters in field names, index expressions,
variable names, window names, and so on, effectively shortens the length of
the name. For example, a field name can be up to 10 bytes long in a free
table, so a field name can consist of 10 single-byte characters, but only 5
double-byte characters. For more information about Visual FoxPro system
capacities, see System Capacities.


*-----------------------------------------------------------

Regards,
Hugo

MAppell917 <mappe...@aol.com> wrote in message
news:20000613013149...@ng-mb1.aol.com...

Gene Wirchenko

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
mappe...@aol.com (MAppell917) wrote:

>Whoops. The term may have been used on minicomputers and mainframes (not sure,
>maybe there are some IBM 360/370 assembly language programmers out there. They
>may have used the term Words it's just been too long).
>
>Definitely not used on micros before the 8088 or 68000 though.

Oh, but it was. Depending on what architecture you're working
on, "word" can have varying meanings. On micros, my experience is
that it's two bytes. I don't know of any exceptions to this, but
wouldn't be surprised if there were/are any.

I worked a bit with IBM 370 mainframes. There, a word is *four*
bytes and two bytes is a "halfword". Just for fun, there is the PSW
(Processor Status Word) (which keeps track of bunch of state) which
is, IIRC, 64 bits (two words). The former usage is the usual though.

[snipped previous]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

MAppell917

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Gene,

Okay, I'll take your WORD for it (no pun intended, lol). Actually, I don't
recall anyone using the term word for microprocessors before the 8088. Perhaps
you are right and it was used, but I'm thinking that I may not have heard it
much (for the micros) because most microprocessors were 8 bits back then and
even the idea of using 16 bits was possible by pairing registers but still, I
just don't remember seeing the term used in any assembly language programming
books. My memory is hazy but a part of me is starting to remember something
about 16bit words, 32 bit words. Doublewords, etc.

I remember programming in Z80 assembly language and often books would just say
something like "load the HL register with FFEA" or with the address FFEA and
we would know 16 bits almost always referred to an address while 8 referred to
the contents of a memory address.

BTW, almost all microcomputers back then with 8 bit microprocessors could
address at most 16 bits of memory or 2 bytes or 2^16 or 64K of RAM - okay, I'm
trying not to stray to far from the subject, but we are trippin' back on memory
lane - nostalgic isn't it? 16K was a HUGE program.


>
>>
>>Definitely not used on micros before the 8088 or 68000 though.
>
> Oh, but it was. Depending on what architecture you're working
>on, "word" can have varying meanings. On micros, my experience is
>that it's two bytes. I don't know of any exceptions to this, but
>wouldn't be surprised if there were/are any.
>


Mike

Markus Voellmy

unread,
Jun 13, 2000, 3:00:00 AM6/13/00
to
Hi Gene

Gene Wirchenko <ge...@shuswap.net> schrieb in im Newsbeitrag: 39464fea...@news.shuswap.net...


: mappe...@aol.com (MAppell917) wrote:
:
: >Whoops. The term may have been used on minicomputers and mainframes (not sure,
: >maybe there are some IBM 360/370 assembly language programmers out there. They
: >may have used the term Words it's just been too long).

: >
: >Definitely not used on micros before the 8088 or 68000 though.


:
: Oh, but it was. Depending on what architecture you're working
: on, "word" can have varying meanings. On micros, my experience is
: that it's two bytes. I don't know of any exceptions to this, but
: wouldn't be surprised if there were/are any.

:

I remember that time. I did then some cross-platform developing in C.
About the only thing that you could rely on varying machines, was the
fact that a longInt normally wasn't shorter than an Integer. :-)

It was quite a confusion when the first of the 68000 and 80286 came
out that had a register width of 32 Bit. The former Z80 (Zilog, you
remember it ? <g> ) and 8088 had had only 16 Bit Data registers.
Every compiler had it's own types with it's own lenghts and names for it.
Often the #IFDEF parts of the code to deal with such vartype issues
were bigger than the real code.

I think the "word" was some sort of "natural" lenght depending on
the processors register width, and as you just said, Gene, that varied
with the targeted processor brand.

One of my "most seen" errors that time was the result of not properly
handled type overflows, sending meaningful bits to the nirwana during
type casting and binary arithmetics. <BG>

Thinking back that far I freely admit I love VFP even more, in spite of
it's known bugs including the partly improper or faulty documentation,
that you often complain. (BTW the translation to the german version,
I use, doesn't do any good to it. <g>).

Regards
Markus


Alex Castillo

unread,
Jun 14, 2000, 3:00:00 AM6/14/00
to
Hello guys..!

At one given computer, the size in bytes of a "word" is the size of the
internal registers on the CPU... that's it, the number of bytes that
microprocessor can handle at the time. Sure the first PCs had 2 bytes long
internal registers, so their words were 2 bytes long, on the other side, in
the 370 (an old good mainframe) the processor had 4 bytes long internal
registers, so it's word was 4 bytes long.

So, the definiiton for word is: The maximum size of data that can be handled
at one time (in one microprocessor cycle) for one given processor, this size
can vary from one microprocessor to other

Of course, the most powerfull a microprocessor is, the longest its word
size.

Greetings..!

Alex Castillo

"Gene Wirchenko" <ge...@shuswap.net> wrote in message
news:39464fea...@news.shuswap.net...


> mappe...@aol.com (MAppell917) wrote:
>
> >Whoops. The term may have been used on minicomputers and mainframes (not
sure,
> >maybe there are some IBM 360/370 assembly language programmers out there.
They
> >may have used the term Words it's just been too long).
> >
> >Definitely not used on micros before the 8088 or 68000 though.
>
> Oh, but it was. Depending on what architecture you're working
> on, "word" can have varying meanings. On micros, my experience is
> that it's two bytes. I don't know of any exceptions to this, but
> wouldn't be surprised if there were/are any.
>

0 new messages