Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monthview Control

Status
Not open for further replies.

wbehning

Programmer
Nov 14, 2001
47
US
I am trying to execute the following line of code:
thisform.monthview.DayBold(thisform.monthview.VisibleDays(1)) = .t.

I keep getting the error "Function argument value, type, or count in invalid.

Does anyone see any problems with my code?
 
Looks like a nice schedule program. (I've been trying to make better but may succomb to a OLE automation ultimately...

You may have fixed your problem by now.

Depending on your UDF coding it may be that the parameter requires quotes like: .Daybold('thisform.monthview.VisibleDays(1)')

If within a method (and/or during compilation: one of your UDFs may need to be converted (character, date, time, numeric, etc.).

Also, the property "DayBold" may not be set up to take this type of parameter at all.

(Of course I may be way off)

Philip M. Traynor, DPM
 
Hello Philip.

>> Depending on your UDF coding it may be that the parameter requires quotes like: .Daybold('thisform.monthview.VisibleDays(1)')<<

I am sorry, but you are way off base here. VisibleDays is not a UDF. It is an array property of the monthView control that contains an array of dates: one for each date being displayed in the control.

>> Also, the property &quot;DayBold&quot; may not be set up to take this type of parameter at all <<

The DayBold property does not require a character parameter. It is an array property of the MonthView control that contains true if the date is displayed using a bold font. It is indexed by date.

So theoretically, wbehning's code should work. Unfortunately, it doesn't. I can reproduce the error and I have not been able to figure out how to get it to work.



Marcia G. Akins
 
Have you tried:
Code:
Local lnTemp
lnTemp = thisform.monthview.VisibleDays(1)thisform.monthview.DayBold(lnTemp) = .t.
I've found that sometimes intermediate values get evaluated wrong.

Rick
 
Try this instead and you should get what you want...

thisform.monthview.object.DayBold(TTOC(thisform.monthview.VisibleDays(1))) = .t.


Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Here's the code I used to test this and I'm providing it for the other members who may wish to see this error reproduced and try some other things with it. (Cut-n-paste code below into a prg file and run it)

PUBLIC oForm
oForm = CREATEOBJECT(&quot;clsMonthView&quot;)
oForm.visible = .T.


DEFINE CLASS clsmonthview AS form


DoCreate = .T.
Caption = &quot;Form&quot;
Name = &quot;clsmonthview&quot;
windowtype = 1

ADD OBJECT olecontrol1 AS olecontrol WITH ;
Top = 36, ;
Left = 10, ;
Height = 200, ;
Width = 228, ;
Name = &quot;MonthView&quot;, ;
OLECLASS = &quot;MSComCtl2.MonthView.2&quot;


ADD OBJECT command1 AS commandbutton WITH ;
Top = 36, ;
Left = 250, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;Show Error&quot;, ;
Name = &quot;Command1&quot;


ADD OBJECT command2 AS commandbutton WITH ;
Top = 75, ;
Left = 250, ;
Height = 27, ;
Width = 84, ;
Caption = &quot;Show Correct&quot;, ;
Name = &quot;Command2&quot;


PROCEDURE command1.Click
thisform.monthview.DayBold(thisform.monthview.VisibleDays(1)) = .t.
ENDPROC


PROCEDURE command2.Click
thisform.monthview.object.DayBold(TTOC(thisform.monthview.VisibleDays(1))) = .t.
ENDPROC


ENDDEFINE

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Thanks for the help. Just what I needed. It all makes sense now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top