Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why can I store more than 254 chars to a memory variable
Message
De
16/05/2001 16:07:42
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00507998
Message ID:
00508080
Vues:
18
Nadya,

Thanks. I will watch out for that. I have seen that error too,but I can't recall where.


>>Craig,
>>
>>Maybe it's me, but I found the help text on this (Overview of the language/data and field types), to be misleading.
>>
>>Thanks for your help.
>
>You can't put it in a Property sheet (its limited), but you sure can assign it in the code.
>
>I found another bug with this limit, which really screwed up one of our application. The application uses listbox with RowSource as array. If you try to put more than 254 chars in this array, you get an error message (As I recall: "String is too long to fit") and the lisbox becomes blank...
>
>It was in my colleague application, and I don't know, did he address this problem or not, but it sounds like a VFP bug. Note, that other RecordSourceTypes don't produce this error.
>
>
>>>>I wanted to store unlimited text in a property of an object. I thought I wouldn't be able to do it. I thought that the limit of a character variable was 254 chars. (As per VFP 6 help) But upon testing I found that I can issue:
>>>>cvar=replicate('x'+254)+replicate('y'+254)
>>>>?type('cvar') && returns C
>>>>?cvar && shows that all 508 chars are stored.
>>>>I thought there would be truncation
>>>>
>>>>I can also issue something like:
>>>>this.myproperty=replicate('x'+254)+replicate('y'+254)
>>>>or
>>>>this.myproperty=mytable.mymemofield
>>>>?type('this.myproperty') && returns C not M
>>>>without a problem
>>>>
>>>>Was this a limitation in earlier (prior to 6) version of VFP, or could you always do this?
>>>>
>>>>TIA
>>>
>>>
>>>254 is the maximum length for a character field. A character variable can be 2 billion bytes.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform