Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Long Strings and command line
Message
 
 
À
29/11/2000 14:15:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00446944
Message ID:
00447155
Vues:
17
Rod,

A string constant is limited to a max size of 256 characters. A string memvar or property can be up to 16Meg. You don't have to use other memvars in your code fragment, but you do have to use the multiple string constants:

lcFullList = "etc,etc,etc,etc,...." + ;
"etc,etc,etc,etc,...." + ;
"etc,etc,etc,etc,...."

You also can not put a string longer that 256 into a property using the property sheet. You can use code in the Init() method:

this.MyLongProperty = "the first ... really long part" + ;
"the rest of my tremendously long value"

this.Tag = replicate( "abcdefghijklmnopqrstuvwxyz", 10000 ) && makes the property 260,000 bytes long.

> I've been bumping into same problem in two areas lately, and I thought it was something that VFP was done with (I was convinced for awhile that SP4 busted something on my setup).
>1) I wrote a loop through an object to create a fieldlist and a varlist for an SQL statement string to use with ado connection.
>The fieldlist and varlist collector statements were something along the lines of: lcFieldList = lcFieldList + obj.arow(i)
>
>2) I tried to set a custom property (a field inclusion list) to a string of about 500 chars.
>
>In both these cases, the statements broke because strings grew to > 256 chars. (I guess), so I had to break them up into separate statements. In the first case, I collected the partial strings into an array, adding an array element whenever the current string was going to exceed 256 chars. Then I concatenated all the element contents together to get the full string.
>In the second case, I had to break up the list, as in
>lcSubList1 = "etc,etc,etc,etc,...."
>lcSubList2 = "etc,etc,etc,etc,...."
>lcSubList3 = "etc,etc,etc,etc,...."
>lcFullList = lcSubList1 + lcSubList2 + lcSubList3
>
>Is there a better way to do this type of stuff with extra long strings? I was under the impression that VFP was over this barrier, but I guess not. If not, is it in VFP7 or the wish list for a future version?
>
>Thanks
>Rod Poujade
>Montreal, Canada
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform