A Beginner
Programmer
I was going through an article of Mr. ChrisRChamberlain- 'How can I create my own status bar.' on the link-
I actually wanted to create a PROGRESSBAR, but attracted by content of the article I tried the codes in the article on my vfp9.0
Problem is that The code is giving syntax error during compilation.
For the referance I am pasting the code as it is -
PUBLIC ofooter
ofooter=NEWOBJECT("footer")
ofooter.Show
RETURN
*************************************************
*-- Form: footer (c:\test\newfooter.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 02/11/03 09:06:00 AM
*
DEFINE CLASS footer AS form
Top = 0
Left = 0
Height = 27
Width = 812
DoCreate = .T.
ShowTips = .T.
BorderStyle = 0
Caption = ""
ControlBox = .F.
Closable = .F.
FontName = "MS Sans Serif"
TitleBar = 0
WindowState = 0
AlwaysOnBottom = .T.
Name = "FOOTER"
lfullsize = .F.
ADD OBJECT cntpanel1 AS container WITH ;
Top = 4, ;
Left = 1, ;
Width = 53, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel1"
ADD OBJECT footer.cntpanel1.image1 AS image WITH ; && The syntax error strikes compilation here.
Picture = "bitmaps\autoname.bmp", ;
BackStyle = 0, ;
Height = 16, ;
Left = 2, ;
Top = 2, ;
Width = 16, ;
Name = "Image1"
ADD OBJECT footer.cntpanel1.label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
Caption = "Label1", ;
Height = 15, ;
Left = 19, ;
Top = 4, ;
Width = 34, ;
Name = "Label1"
ADD OBJECT cntpanel2 AS container WITH ;
Top = 4, ;
Left = 277, ;
Width = 224, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel2"
ADD OBJECT footer.cntpanel2.txtprogressbar AS textbox WITH ;
FontBold = .F., ;
FontName = "MS Sans Serif", ;
Alignment = 2, ;
BorderStyle = 1, ;
Enabled = .F., ;
Height = 20, ;
Left = 0, ;
ReadOnly = .T., ;
TabStop = .F., ;
Top = 0, ;
Visible = .F., ;
Width = 432, ;
DisabledBackColor = RGB(255,255,255), ;
DisabledForeColor = RGB(0,0,0), ;
Name = "txtProgressBar"
ADD OBJECT cntpanel3 AS container WITH ;
Top = 4, ;
Left = 523, ;
Width = 21, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel3"
ADD OBJECT footer.cntpanel3.oleaviplayer AS olecontrol WITH ;
Top = 2, ;
Left = 2, ;
Height = 16, ;
Width = 16, ;
Name = "oleAviPlayer"
ADD OBJECT cntpanel4 AS container WITH ;
Top = 4, ;
Left = 547, ;
Width = 51, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel4"
ADD OBJECT footer.cntpanel4.label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
Caption = "Label1", ;
Height = 15, ;
Left = 4, ;
Top = 4, ;
Width = 34, ;
Name = "Label1"
ADD OBJECT cntpanel5 AS container WITH ;
Top = 4, ;
Left = 600, ;
Width = 55, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel5"
ADD OBJECT footer.cntpanel5.label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
Caption = "Label1", ;
Height = 15, ;
Left = 3, ;
Top = 4, ;
Width = 34, ;
Name = "Label1"
ADD OBJECT tmrtime AS timer WITH ;
Top = 0, ;
Left = 684, ;
Height = 23, ;
Width = 23, ;
Interval = 1000, ;
Name = "tmrTime"
PROCEDURE mcntlabel1
LPARAMETERS cFile, cLine1
WITH THIS
.cntPanel1.Image1.Picture = cFile
.cntPanel1.Label1.Caption = cLine1
ENDWITH
ENDPROC
PROCEDURE mcntlabel3
LPARAMETERS cFile, cAction
THIS.cntPanel3.oleAviPlayer.Open(cFile)
lcExpr = [THIS.cntPanel3.oleAviPlayer.] + cAction
&lcExpr
ENDPROC
PROCEDURE Resize
WITH THIS
.Height = 27
.Top = _SCREEN.Height - 27
.Width = _SCREEN.Width
WITH .cntPanel2
.Left = _SCREEN.Width - 338
.Width = 200
ENDW
WITH .cntPanel3
.Left = _SCREEN.Width - 136
ENDWITH
WITH .cntPanel4
.Left = _SCREEN.Width - 113
ENDWITH
WITH .cntPanel5
.Left = _SCREEN.Width - 60
ENDWITH
WITH .cntPanel1 && The one panel that resizes
.Left = 3
.Width = _SCREEN.Width - 343
ENDW
ENDW
ENDPROC
PROCEDURE Init
THIS.Resize()
THIS.mCntLabel1([],[This is a test, and an even bigger test])
THIS.mCntLabel2()
THIS.mCntLabel3([bitmaps\n3.avi],[Play])
ENDPROC
PROCEDURE Destroy
RELE oFooter
ENDPROC
PROCEDURE mcntlabel2
ENDPROC
PROCEDURE mcntlabel4
ENDPROC
PROCEDURE mcntlabel5
ENDPROC
PROCEDURE label1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.ToolTipText = THIS.Caption
ENDPROC
PROCEDURE label1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.ToolTipText = [The time is ] + THIS.Caption
ENDPROC
PROCEDURE label1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.ToolTipText = [The date is ] + THIS.Caption
ENDPROC
PROCEDURE tmrtime.Timer
THISFORM.cntPanel4.Label1.Caption = TIME()
ENDPROC
ENDDEFINE
*
*-- EndDefine: footer
**************************************************
The error comes at the first add object only-
ADD OBJECT footer.cntpanel1.image1 AS image WITH.
My QUESTION here is:
HOW TO TROUBLESHOOT THE ERROR. I WANT TO BE ABLE TO USE THE CODE LIKE THIS- (as it reduces codes)
'ADD OBJECT footer.cntpanel1.image1 AS image WITH'
Thank you
I actually wanted to create a PROGRESSBAR, but attracted by content of the article I tried the codes in the article on my vfp9.0
Problem is that The code is giving syntax error during compilation.
For the referance I am pasting the code as it is -
PUBLIC ofooter
ofooter=NEWOBJECT("footer")
ofooter.Show
RETURN
*************************************************
*-- Form: footer (c:\test\newfooter.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 02/11/03 09:06:00 AM
*
DEFINE CLASS footer AS form
Top = 0
Left = 0
Height = 27
Width = 812
DoCreate = .T.
ShowTips = .T.
BorderStyle = 0
Caption = ""
ControlBox = .F.
Closable = .F.
FontName = "MS Sans Serif"
TitleBar = 0
WindowState = 0
AlwaysOnBottom = .T.
Name = "FOOTER"
lfullsize = .F.
ADD OBJECT cntpanel1 AS container WITH ;
Top = 4, ;
Left = 1, ;
Width = 53, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel1"
ADD OBJECT footer.cntpanel1.image1 AS image WITH ; && The syntax error strikes compilation here.
Picture = "bitmaps\autoname.bmp", ;
BackStyle = 0, ;
Height = 16, ;
Left = 2, ;
Top = 2, ;
Width = 16, ;
Name = "Image1"
ADD OBJECT footer.cntpanel1.label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
Caption = "Label1", ;
Height = 15, ;
Left = 19, ;
Top = 4, ;
Width = 34, ;
Name = "Label1"
ADD OBJECT cntpanel2 AS container WITH ;
Top = 4, ;
Left = 277, ;
Width = 224, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel2"
ADD OBJECT footer.cntpanel2.txtprogressbar AS textbox WITH ;
FontBold = .F., ;
FontName = "MS Sans Serif", ;
Alignment = 2, ;
BorderStyle = 1, ;
Enabled = .F., ;
Height = 20, ;
Left = 0, ;
ReadOnly = .T., ;
TabStop = .F., ;
Top = 0, ;
Visible = .F., ;
Width = 432, ;
DisabledBackColor = RGB(255,255,255), ;
DisabledForeColor = RGB(0,0,0), ;
Name = "txtProgressBar"
ADD OBJECT cntpanel3 AS container WITH ;
Top = 4, ;
Left = 523, ;
Width = 21, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel3"
ADD OBJECT footer.cntpanel3.oleaviplayer AS olecontrol WITH ;
Top = 2, ;
Left = 2, ;
Height = 16, ;
Width = 16, ;
Name = "oleAviPlayer"
ADD OBJECT cntpanel4 AS container WITH ;
Top = 4, ;
Left = 547, ;
Width = 51, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel4"
ADD OBJECT footer.cntpanel4.label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
Caption = "Label1", ;
Height = 15, ;
Left = 4, ;
Top = 4, ;
Width = 34, ;
Name = "Label1"
ADD OBJECT cntpanel5 AS container WITH ;
Top = 4, ;
Left = 600, ;
Width = 55, ;
Height = 20, ;
SpecialEffect = 1, ;
Name = "cntPanel5"
ADD OBJECT footer.cntpanel5.label1 AS label WITH ;
AutoSize = .T., ;
FontName = "MS Sans Serif", ;
Caption = "Label1", ;
Height = 15, ;
Left = 3, ;
Top = 4, ;
Width = 34, ;
Name = "Label1"
ADD OBJECT tmrtime AS timer WITH ;
Top = 0, ;
Left = 684, ;
Height = 23, ;
Width = 23, ;
Interval = 1000, ;
Name = "tmrTime"
PROCEDURE mcntlabel1
LPARAMETERS cFile, cLine1
WITH THIS
.cntPanel1.Image1.Picture = cFile
.cntPanel1.Label1.Caption = cLine1
ENDWITH
ENDPROC
PROCEDURE mcntlabel3
LPARAMETERS cFile, cAction
THIS.cntPanel3.oleAviPlayer.Open(cFile)
lcExpr = [THIS.cntPanel3.oleAviPlayer.] + cAction
&lcExpr
ENDPROC
PROCEDURE Resize
WITH THIS
.Height = 27
.Top = _SCREEN.Height - 27
.Width = _SCREEN.Width
WITH .cntPanel2
.Left = _SCREEN.Width - 338
.Width = 200
ENDW
WITH .cntPanel3
.Left = _SCREEN.Width - 136
ENDWITH
WITH .cntPanel4
.Left = _SCREEN.Width - 113
ENDWITH
WITH .cntPanel5
.Left = _SCREEN.Width - 60
ENDWITH
WITH .cntPanel1 && The one panel that resizes
.Left = 3
.Width = _SCREEN.Width - 343
ENDW
ENDW
ENDPROC
PROCEDURE Init
THIS.Resize()
THIS.mCntLabel1([],[This is a test, and an even bigger test])
THIS.mCntLabel2()
THIS.mCntLabel3([bitmaps\n3.avi],[Play])
ENDPROC
PROCEDURE Destroy
RELE oFooter
ENDPROC
PROCEDURE mcntlabel2
ENDPROC
PROCEDURE mcntlabel4
ENDPROC
PROCEDURE mcntlabel5
ENDPROC
PROCEDURE label1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.ToolTipText = THIS.Caption
ENDPROC
PROCEDURE label1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.ToolTipText = [The time is ] + THIS.Caption
ENDPROC
PROCEDURE label1.MouseEnter
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.ToolTipText = [The date is ] + THIS.Caption
ENDPROC
PROCEDURE tmrtime.Timer
THISFORM.cntPanel4.Label1.Caption = TIME()
ENDPROC
ENDDEFINE
*
*-- EndDefine: footer
**************************************************
The error comes at the first add object only-
ADD OBJECT footer.cntpanel1.image1 AS image WITH.
My QUESTION here is:
HOW TO TROUBLESHOOT THE ERROR. I WANT TO BE ABLE TO USE THE CODE LIKE THIS- (as it reduces codes)
'ADD OBJECT footer.cntpanel1.image1 AS image WITH'
Thank you