**********************************************************
* Author : Ramani (Subramanian.G)
* FoxAcc Software / Winners Software
* Type : Freeware with reservation to Copyrights
* Warranty : Nothing implied or explicit
***********************************************************
* How to use:
* 1. Copy the following as GsKb.PRG.
* 2. From the command window Type.. DO gskb
* 3. The form starts a browser instance.
* Use this for browsing.
* When you want to save the content of a page
* switch to gsKb and click on Add. Follow it.
* 4. If you close the browser, by mistake,
* close the gskb and start it again- DO gskb.
* Else an error will popup.. close and exit.
* 5. This is used by me and so, provided as it is
* without much tighter user controls.
* 6. I will think users at large and
* add error routines OR a better way to do same
* ... when time permits
*************************************************
* PROCEDURE gsKb
PUBLIC okbarticle
ADD OBJECT cmdAdd AS commandbutton WITH ;
Top = 12, ;
Left = 24, ;
Height = 27, ;
Width = 60, ;
Caption = "Add", ;
Name = "cmdAdd"
ADD OBJECT cmddel AS commandbutton WITH ;
Top = 12, ;
Left = 84, ;
Height = 27, ;
Width = 60, ;
Caption = "Delete", ;
Name = "cmdDel"
ADD OBJECT cmdnav AS commandbutton WITH ;
Top = 12, ;
Left = 144, ;
Height = 27, ;
Width = 60, ;
Caption = "GoToURL", ;
Name = "cmdNav"
ADD OBJECT cmdfirst AS commandbutton WITH ;
Top = 12, ;
Left = 204, ;
Height = 27, ;
Width = 60, ;
Caption = "First", ;
Name = "cmdFirst"
ADD OBJECT cmdprev AS commandbutton WITH ;
Top = 12, ;
Left = 264, ;
Height = 27, ;
Width = 60, ;
Caption = "Previous", ;
Name = "cmdPrev"
ADD OBJECT cmdnext AS commandbutton WITH ;
Top = 12, ;
Left = 324, ;
Height = 27, ;
Width = 60, ;
Caption = "Next", ;
Name = "cmdNext"
ADD OBJECT cmdlast AS commandbutton WITH ;
Top = 12, ;
Left = 384, ;
Height = 27, ;
Width = 60, ;
Caption = "Last", ;
Name = "cmdLast"
ADD OBJECT cmdExit AS commandbutton WITH ;
Top = 12, ;
Left = 444, ;
Height = 27, ;
Width = 60, ;
Caption = "Exit", ;
Name = "cmdExit"
ADD OBJECT grdkb AS grid WITH ;
DeleteMark = .F., ;
Height = 111, ;
Left = 12, ;
ReadOnly = .T., ;
Top = 60, ;
Width = 576, ;
Name = "grdKb"
ADD OBJECT edtArticle AS editbox WITH ;
Height = 132, ;
Left = 12, ;
Top = 180, ;
Width = 576, ;
DisabledForeColor = RGB(255,255,255), ;
Name = "edtArticle"
PROCEDURE Init
SET DELETED ON
IF ! FILE('KB.DBF')
CREATE TABLE kb (art_categ C(10), ;
art_title C(35), article M, url M)
INDEX ON art_title TAG art_title
INDEX ON art_categ TAG art_categ
USE
ENDIF
SELECT 0
USE kb ORDER art_title ALIAS kb
WITH Thisform
.EdtArticle.ControlSource = "kb.article"
.grdKb.RecordSource = "kb"
.grdKb.RecordSourceType = 1
cSite = 'http://www.winnersoft.coolfreepages.com'
.AddProperty("oBrowser", ;
CREATEOBJECT("internetexplorer.application"))
.oBrowser.Navigate(cSite)
.oBrowser.Visible = .T.
ENDWITH
ENDPROC
PROCEDURE cmdAdd.Click
LOCAL lcCategory
lcCategory = SPACE(10)
lcCategory = INPUTBOX("Category ", ;
"New Knowledge Article", lcCategory)
lcTitle = SPACE(30)
IF ! EMPTY(lcCategory)
lcTitle = INPUTBOX("Title ", ;
"New Knowledge Article", lcTitle)
IF ! EMPTY(lcTitle)
_clipText = ""
ThisForm.Obrowser.Document.ExecCommand("COPY")
lcArticle = _clipText
IF EMPTY(lcArticle)
ThisForm.Obrowser.Document.ExecCommand("SelectAll")
ThisForm.Obrowser.Document.ExecCommand("Copy")
ENDIF
lcArticle = _clipText
ThisForm.Obrowser.Document.ExecCommand("UnSelect")
**
lcAddress = ThisForm.oBrowser.LocationUrl
IF !EMPTY(lcArticle)
INSERT INTO kb(art_categ, art_title, article, url) ;
VALUES (lcCategory, lcTitle, lcArticle, lcAddress)
ELSE
MESSAGEBOX("You must select text in the browser instance",;
0, "Data incomplete")
ENDIF
ELSE
MESSAGEBOX("You must specify a Title for this Knowledge Article", ;
0, "Data incomplete")
ENDIF
ELSE
MESSAGEBOX("You must specify a catagory", ;
0, "Data incomplete")
ENDIF
ThisForm.Refresh()
**
ENDPROC
PROCEDURE cmdfirst.Click
GO TOP
ThisForm.Refresh()
ThisForm.grdKb.SetFocus()
ENDPROC
PROCEDURE cmdprev.Click
IF !BOF()
SKIP -1
ThisForm.Refresh()
ThisForm.grdKb.SetFocus()
ENDIF
ENDPROC
PROCEDURE cmdnext.Click
IF !EOF()
SKIP
IF EOF()
SKIP -1
ENDIF
ThisForm.Refresh()
ThisForm.grdKb.SetFocus()
ENDIF
ENDPROC
PROCEDURE cmdlast.Click
GO BOTTOM
ThisForm.Refresh()
ThisForm.grdKb.SetFocus()
ENDPROC
PROCEDURE cmddel.Click
DELETE NEXT 1
ThisForm.cmdNext.Click()
ENDPROC
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.