Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How long can be a string for a property?
Message
De
18/08/2019 06:18:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/08/2019 22:32:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrats & ententes
Divers
Thread ID:
01670126
Message ID:
01670147
Vues:
65
It is not about having a clear or vague memory. The code I provided clearly demonstrates that it is NOT the case and VFP itself has it documented.


>Yes, I have a clear memory of that being the case. I think Tamar documented it, in fact.
>
>>>>>Hi,
>>>>>
>>>>>I am storing a long SQL Select string into a property of a form (property name SQL_SELECT). So far, I don't get any errors.
>>>>>But, just in case, what is the max length of the string I could store in a property?
>>>>>
>>>>>TIA
>>>>
>>>>For an SQL select string it is 8192.
>>>
>>>Note that this is the "compiled" length not the text length. I remembered that much -- I forget how to get the compiled length.
>>>
>>>Hank
>>
>>Are you sure it is not the text length but compiled length?
>>
>>
>>CREATE CURSOR mytable (dummy c(10))
>>INSERT INTO mytable VALUES ('a')
>>
>>lcSQL = "Select * from myTable where myTable.Dummy = 'a' INTO CURSOR crsDummy nofilter"
>>lcDummy = space(8192-LEN(m.lcSQL)+1)
>>
>>Select * from myTable where myTable.Dummy = 'a' &lcDummy.INTO CURSOR crsDummy nofilter
>>
>>
>>This fails for me. If I decrease the command line length by changing + 1 to -2 it works.
>>Same happens here:
>>
>>Public oForm
>>
>>oForm = Createobject('MyForm')
>>oForm.Show()
>>
>>Define Class MyForm As Form
>>	Add Object lb As ListBox
>>
>>	Procedure Load
>>		Create Cursor mytable (dummy c(10))
>>		Insert Into mytable Values ('a')
>>	Endproc
>>
>>	Procedure lb.Init
>>		lcSQL = "Select * from myTable where myTable.Dummy = 'a' INTO CURSOR crsDummy nofilter"
>>		lcDummy = Space(8192-Len(m.lcSQL)+1)
>>
>>		This.RowSourceType=3
>>		This.RowSource = "Select * from myTable where myTable.Dummy = 'a' "+m.lcDummy+"INTO CURSOR crsDummy nofilter"
>>	Endproc
>>Enddefine
>>
>>
>>I am pretty sure in both cases compiled length would be much shorter if it didn't deny to compile.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform