Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Column ControlSource Problem
Message
From
14/02/2002 02:00:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00619455
Message ID:
00619878
Views:
15
Simon,
I used the exact same string you supplied (only typo corrected) and it worked in controlsource (of course I created the 3 cursors and methods:).
Cetin

>Hi Cetin
>
>I see the error in the code shown in my initial post but the actual code does not have any errors. It was a typo when I created this thread.
>
>I have tested this many times the problem is not an error in the string because to test I cut and paste it into the getColumn1Text method and it works. So I just kept reducing the length of the string until it worked. I will have to do further testing but I know the limit is close to 220 characters after that it fails.
>
>
>Simon
>
>
>>Simon,
>>Actually in documents it states 255 for max len literal strings (Capacities). Here with 240 chars I don't think it's char limit but an error in expression. Probably you wrote it right for your method. What happens if you put the controlsource in grid init like this :
>>
>>
>>This.myColumnx.Controlsource = ;
>>[(ThisForm.LongDate(AMSched.Date)+" "+]+;
>>[ThisForm.GetTime(AMSched.Time)+]+;
>>[" "+ThisForm.dCSeek(AMSched.Sport,"AMActvty","ID","AMActvty.Desc")+" "+]+;
>>[ThisForm.dCSeek(AMSched.Opponent1,"AMMaster","ID","AMMaster.Id1")+" vs "+]+;
>>[ThisForm.dCSeek(AMSched.Opponent2,"AMMaster","ID","AMMaster.Id1"))]
>>
>>Cetin
>>
>>>Hi
>>>
>>>There is no indication in the documentation of how long a string can be used in the controlsource of a column. However, I do know that if I put a long expression (240 Characters) in the controlsource nothing will be displayed in the grid and no error message will be given. Should this be considered a bug?
>>>
>>>The reason this is a problem is that I have an application where the user wants to see a list of game dates and opponents in a grid column. Since the opponents are stored as unique ID number I do a lookup to find the name to be displayed. The resulting controlsource looks as follows:
>>>
>>>
>>>Column1.ControlSource=ThisForm.LongDate(AMSched.Date)+" "+;
>>>ThisForm.GetTime(AMSched.Time)+;
>>>" "+ThisForm.dCSeek(AMSched.Sport","AMActvty","ID","AMActvty.Desc")+" "+;
>>>ThisForm.dCSeek(AMSched.Opponent1,"AMMaster","ID","AMMaster.Id1")+" vs "+;
>>>ThisForm.dCSeek(AMSched.Opponent2,"AMMaster","ID","AMMaster.Id1")
>>>
>>>
>>>The above code will not display anything in the grid. If I replace the code with the following everything works fine:
>>>
>>>
>>>Column1.ControlSource=ThisForm.GetColumn1Text()
>>>
>>>Procedure ThisForm.GetColumn1Text
>>>   Return ThisForm.LongDate(AMSched.Date)+" "+;
>>>      ThisForm.GetTime(AMSched.Time)+;
>>>      " "+ThisForm.dCSeek(AMSched.Sport","AMActvty","ID","AMActvty.Desc")+" "+;
>>>      ThisForm.dCSeek(AMSched.Opponent1,"AMMaster","ID","AMMaster.Id1")+" vs "+;
>>>      ThisForm.dCSeek(AMSched.Opponent2,"AMMaster","ID","AMMaster.Id1")
>>>EndProc
>>>
>>>
>>>
>>>
>>>Simon
Ç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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform