Today we have an Indian Festival called Diwali.
Diwali is a festival of lights.
A large number of people also have Lakshmi Pooja.
Lakshmi is Goddess of 'money' and 'wealth'.
Those who do this and have business, start their new book-keeping records this day.
I wish all those Indians who visit here a Happy Diwali and share the festive mood with all members here.
You can copy and run the following code for fun.
A VFP way of greeting (part of these code credit shared with Monikai, a member of out forum.)
The greetings card's first three lines can be changed to fit with the occassion. (tCaption1,tCaption2,tGif values).
This can be incoprporated in applications and used for flashing NewYear or Christmas messages based on Date value and passing the string values as parameters.
Suitably Star-out in the below code..
If you have a small gif file to go with the occassion, you can use it as well. The absence of gif will not create any error.
**********************************************
tCaption1 = "Dear Tek-Tips members & visitors"
tCaption2 = " ..... Happy Diwali - Ramani"
tGif = "diwali.gif" && dont worry about its absence
**********************************************
** Greeting.PRG
** How to run ..
** =Greeting("Happy Diwali",".......... from Ramani"
**********************************************
** Greetings Card form
** PARAMETERS tCaption1, tCaption2, tGif
PUBLIC oform1
oform1=NEWOBJECT("gForm",'','',tCaption1,tCaption2, tGif)
oForm1.TitleBar = 0 && if you wish to have no titlebar
oform1.Show
RETURN
**********************************************
**********************************************
DEFINE CLASS gForm AS form
Height = 454
Width = 633
DoCreate = .T.
BackColor = RGB(255,192,128)
Name = "Greetings"
cSnow = "'"
nSnow = 0
nSnowFont = 20
Add object Text1 as label with ;
AutoSize = .T., ;
BackStyle = 0, ;
FontBold = .T., ;
FontItalic = .T., ;
FontSize = 28, ;
Name = "Text1"
Add object Text2 as label with ;
AutoSize = .T., ;
BackStyle = 0, ;
FontBold = .T., ;
FontItalic = .T., ;
FontSize = 28, ;
Left = 96, ;
Top = 216, ;
Name = "Text2"
PROCEDURE init
PARAMETERS tCaption1, tCaption2, tGif
IF EMPTY(tCaption2)
tCaption2 = "from Subramanian.G."
ENDIF
IF EMPTY(tCaption1)
tCaption1 = "Greetings !!!"
ENDIF
**
WITH ThisForm
.Text1.Caption = tCaption1
.Text2.Caption = tCaption2
.ADDOBJECT("Image1","Image"
WITH .Image1
.Picture = tGif
.Stretch = 2
.Width = ThisForm.Width/4
.Height = ThisForm.Height/4
.Top = ThisForm.Height/1.4
.Left = ThisForm.Width/8
.Zorder(1)
IF ! FILE(.Picture)
.Visible = .f.
ELSE
.Visible = .t.
ENDIF
ENDWITH
**
.nSNow = 50 && Max of t*i
x = 1
FOR t=0 TO 5
FOR I=1 TO 10
cI = ALLTRIM(STR((t*10)+I))
.ADDOBJECT("greet&cI","LABEL"
.greet&cI..AutoSize = .T.
.greet&cI..BackStyle = 0
.greet&cI..FontBold = .T.
.greet&cI..FontSize = ThisForm.nSnowFont
.greet&cI..Caption = ThisForm.cSnow
** Diwali Special
DO CASE
CASE x = 1
.greet&cI..Caption = CHR(36)
CASE x = 2
.greet&cI..Caption = CHR(162)
CASE x = 3
.greet&cI..Caption = CHR(163)
CASE x = 4
.greet&cI..Caption = CHR(165)
CASE x = 5
.greet&cI..Caption = "€"
x = 0
ENDCASE
x = x+1
**
.greet&cI..Left = (i*50) + (10*rand())
.greet&cI..Top = (t*90) + (10*rand())
.greet&cI..Name = "greet&cI"
** .greet&cI..ForeColor = RGB(192,192,192)
.greet&cI..ForeColor = RGB(0,0,255)
.greet&cI..Visible = .t.
ENDFOR
ENDFOR
.ADDOBJECT("Timer1","Timer1"
ENDWITH
ENDPROC
PROCEDURE KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27
ThisForm.Release()
ENDIF
ENDPROC
ENDDEFINE
**********************************************
DEFINE CLASS timer1 AS Timer
Interval = 100
Name = "Timer1"
PROCEDURE Timer
WITH ThisForm
.Text2.forecolor = .Text1.ForeColor
DO CASE
CASE .Text1.forecolor=16711680
.Text1.forecolor=255
CASE .Text1.forecolor=255
.Text1.forecolor=8421376
CASE .Text1.forecolor=8421376
.Text1.forecolor=8388863
OTHERWISE
.Text1.forecolor=16711680
ENDCASE
ENDWITH
**
FOR i= 1 TO ThisForm.nSnow
zm_g='thisform.greet'+alltrim(str(i))
zm_gl=zm_g+'.left'
IF &zm_gl<572
&zm_gl=&zm_gl+10*rand()
ELSE
&zm_gl=1
ENDIF
zm_gl=zm_g+'.top'
IF &zm_gl<392
&zm_gl=&zm_gl+10*rand()
ELSE
&zm_gl=1
ENDIF
ENDFOR
ENDPROC
ENDDEFINE
**********************************************
** EOF
**********************************************
May be some day I will create an FAQ with this.
-Ramani
ramani
(Subramanian.G)
Diwali is a festival of lights.
A large number of people also have Lakshmi Pooja.
Lakshmi is Goddess of 'money' and 'wealth'.
Those who do this and have business, start their new book-keeping records this day.
I wish all those Indians who visit here a Happy Diwali and share the festive mood with all members here.
You can copy and run the following code for fun.
A VFP way of greeting (part of these code credit shared with Monikai, a member of out forum.)
The greetings card's first three lines can be changed to fit with the occassion. (tCaption1,tCaption2,tGif values).
This can be incoprporated in applications and used for flashing NewYear or Christmas messages based on Date value and passing the string values as parameters.
Suitably Star-out in the below code..
If you have a small gif file to go with the occassion, you can use it as well. The absence of gif will not create any error.
**********************************************
tCaption1 = "Dear Tek-Tips members & visitors"
tCaption2 = " ..... Happy Diwali - Ramani"
tGif = "diwali.gif" && dont worry about its absence
**********************************************
** Greeting.PRG
** How to run ..
** =Greeting("Happy Diwali",".......... from Ramani"
**********************************************
** Greetings Card form
** PARAMETERS tCaption1, tCaption2, tGif
PUBLIC oform1
oform1=NEWOBJECT("gForm",'','',tCaption1,tCaption2, tGif)
oForm1.TitleBar = 0 && if you wish to have no titlebar
oform1.Show
RETURN
**********************************************
**********************************************
DEFINE CLASS gForm AS form
Height = 454
Width = 633
DoCreate = .T.
BackColor = RGB(255,192,128)
Name = "Greetings"
cSnow = "'"
nSnow = 0
nSnowFont = 20
Add object Text1 as label with ;
AutoSize = .T., ;
BackStyle = 0, ;
FontBold = .T., ;
FontItalic = .T., ;
FontSize = 28, ;
Name = "Text1"
Add object Text2 as label with ;
AutoSize = .T., ;
BackStyle = 0, ;
FontBold = .T., ;
FontItalic = .T., ;
FontSize = 28, ;
Left = 96, ;
Top = 216, ;
Name = "Text2"
PROCEDURE init
PARAMETERS tCaption1, tCaption2, tGif
IF EMPTY(tCaption2)
tCaption2 = "from Subramanian.G."
ENDIF
IF EMPTY(tCaption1)
tCaption1 = "Greetings !!!"
ENDIF
**
WITH ThisForm
.Text1.Caption = tCaption1
.Text2.Caption = tCaption2
.ADDOBJECT("Image1","Image"
WITH .Image1
.Picture = tGif
.Stretch = 2
.Width = ThisForm.Width/4
.Height = ThisForm.Height/4
.Top = ThisForm.Height/1.4
.Left = ThisForm.Width/8
.Zorder(1)
IF ! FILE(.Picture)
.Visible = .f.
ELSE
.Visible = .t.
ENDIF
ENDWITH
**
.nSNow = 50 && Max of t*i
x = 1
FOR t=0 TO 5
FOR I=1 TO 10
cI = ALLTRIM(STR((t*10)+I))
.ADDOBJECT("greet&cI","LABEL"
.greet&cI..AutoSize = .T.
.greet&cI..BackStyle = 0
.greet&cI..FontBold = .T.
.greet&cI..FontSize = ThisForm.nSnowFont
.greet&cI..Caption = ThisForm.cSnow
** Diwali Special
DO CASE
CASE x = 1
.greet&cI..Caption = CHR(36)
CASE x = 2
.greet&cI..Caption = CHR(162)
CASE x = 3
.greet&cI..Caption = CHR(163)
CASE x = 4
.greet&cI..Caption = CHR(165)
CASE x = 5
.greet&cI..Caption = "€"
x = 0
ENDCASE
x = x+1
**
.greet&cI..Left = (i*50) + (10*rand())
.greet&cI..Top = (t*90) + (10*rand())
.greet&cI..Name = "greet&cI"
** .greet&cI..ForeColor = RGB(192,192,192)
.greet&cI..ForeColor = RGB(0,0,255)
.greet&cI..Visible = .t.
ENDFOR
ENDFOR
.ADDOBJECT("Timer1","Timer1"
ENDWITH
ENDPROC
PROCEDURE KeyPress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27
ThisForm.Release()
ENDIF
ENDPROC
ENDDEFINE
**********************************************
DEFINE CLASS timer1 AS Timer
Interval = 100
Name = "Timer1"
PROCEDURE Timer
WITH ThisForm
.Text2.forecolor = .Text1.ForeColor
DO CASE
CASE .Text1.forecolor=16711680
.Text1.forecolor=255
CASE .Text1.forecolor=255
.Text1.forecolor=8421376
CASE .Text1.forecolor=8421376
.Text1.forecolor=8388863
OTHERWISE
.Text1.forecolor=16711680
ENDCASE
ENDWITH
**
FOR i= 1 TO ThisForm.nSnow
zm_g='thisform.greet'+alltrim(str(i))
zm_gl=zm_g+'.left'
IF &zm_gl<572
&zm_gl=&zm_gl+10*rand()
ELSE
&zm_gl=1
ENDIF
zm_gl=zm_g+'.top'
IF &zm_gl<392
&zm_gl=&zm_gl+10*rand()
ELSE
&zm_gl=1
ENDIF
ENDFOR
ENDPROC
ENDDEFINE
**********************************************
** EOF
**********************************************
May be some day I will create an FAQ with this.
-Ramani
ramani
(Subramanian.G)