Resource handling predefined procedures and functions

 

OpenForm ( opmode, formname )

OpenForm ( opmode, formname, datamode )

OpenForm ( opmode, formname, datamode, op, filter )

OpenFormModal ( opmode, formname )

OpenFormModal ( opmode, formname, datamode )

OpenFormModal ( opmode, formname, datamode, op, filter )

 

This procedure opens the form with resource name formname in an operation mode opmode ( ptAppend, ptEdit, ptDelete, ptReport, ptBrowse, ptPrint ). The op is always (1). Lets give some examples:

 

 

  call OpenForm(ptReport,"REP1.RT")                               '...open the report REP1.RT

  call OpenForm(ptAppend,"USER1.FM","WORK.USERTABLE",1)                '...append a new user record

  call OpenForm(ptEdit,"USER1.FM","WORK.USERTABLE",1,"?=USER_ID")       '....get the value of user id from the form bellow

  call OpenForm(ptEdit,"USER1.FM","WORK.USERTABLE",1,"100=USER_ID")   '...the value for the user id is 100

  call OpenForm(ptDelete,"USER1.FM","WORK.USERTABLE",1,"100=USER_ID")  '...delete the record with user id = 100

 

 

CloseForm ( closeflag )

CloseForm ( closeflag, ask_flag, stay_flag )
CloseForm ( form_id )

 

This procedure closes the form that has the focus. If closeflag is True then the form is saved to the database, if the ask_flag is (1) then the system ask if the form is going to close. If the stay_flag is (1) then the form saves to the database and stays opened and blank for the next data to appended to the database. The last variation of CloseForm closes the form that has the form_id - not only the top one - and all other parameters are by default False. (i.e. the form is closing without data posting)

 

AskCloseForm   

 

FindComponent ( f, cname )

 

This function returns the handle of the component cname into the form with handle f.

 

TByName ( dg, tname )

 

This function returns the handle of table with name tname in the data group dg of a form.

 

FByTableName ( tname )

 

This function returns the handle of the form that is servicing records of table tname. The searched form must be already opened.

 

FByResName ( fname )

 

This function returns the handle of the form that has resource name fname. The searched form must be already opened.

 

PByName ( fhandle, pname )

 

This function returns the handle of the data group named pname on the opened form with handle fhande.

 

Input ( capt, prompt, val )

 

This function returns a value, after a small form with caption capt is opened. This function has as leading label the prompt and default value the val.

 

TopForm()

 

This function returns the handle of the form that has the focus.

 

PreviousForm ( fhandle )

 

This function returns the handle of the form that is previous of the form with handle fhandle.

 

SaveFormToIni ( fhadle, inifile )

 

This procedure saves the contents of the form with handle fhandle to the ini file inifile. The ini file resides on the resource directory. This is applied when small chucks of data are stored to local files than in the database.

 

LoadFormFromIni ( fhadle, inifile )

 

This procedure loads the contents of the ini file inifile to the form with handle fhandle . The ini file resides on the resource directory. This is applied when small chucks of data are stored to local files than in the database. The ini file must have previously saved with the SaveFormToIni.

 

BrowseFirst()

 

This procedure advances the current form (in case of the report) in the first page. If the form is a recordset browsing form then advances the recorset to the first record.

 

BrowseLast()

 

This procedure advances the current form (in case of the report) in the last page. If the form is a recordset browsing form then advances the recorset to the last record.

 

BrowseNext()

 

This procedure advances the current form (in case of the report) in the next page. If the form is a recordset browsing form then advances the recorset to the next record.

 

BrowsePrior()

 

This procedure advances the current form (in case of the report) in the prior page. If the form is a recordset browsing form then advances the recorset to the prior record.

 

FirstPage()

 

This procedure sets as active page, in a multi page form, the first page.

 

NextPage()

 

This procedure sets as active page, in a multi page form, the next of the active page.

 

PriorPage()

 

This procedure sets as active page, in a multi page form, the prior of the active page.

 

LastPage()

 

This procedure sets as active page, in a multi page form, the last page.

 

CopyTrans ( f )

 

This procedure copies the contents of the form with handle f.

 

PasteTrans ( f )

 

This procedure pastes to the form with handle f whatever previously has been copied with a CopyTrans. Those procedures have meaning only in forms of the same recodset(s).

 

message ( p1, p2, ... )

 

This procedure shows the message that is the concatenation of p1, p2, .... In case the procedure is called inside an html file then the message outputs the concatenated sting to the html file.

 

SetFixedRows ( count )

 

This procedure sets as count the fixed rows (starting from the begining) in a recordset browsing form.

 

SetFixedCols ( count )

 

This procedure sets as count the fixed columns (starting from the begining) in a recordset browsing form.

 

LogException1 ( p1, p2, ... )

 

This procedure writes the message that is the concatenation of p1, p2, ....to the kosmos.log file. Later the kosmos.log can be examined by the programmer.

 

Escape ( asci1, asci2, ..., -1)

 

This function returns a string of (unprintable) sequence of ascii codes. The sequence ends by -1.

 

codevar ( varname )

 

This function returns the value of variable named varname. This fuction is used in expression in form or report fields. The varname is a variable previously calculated in the AutoScript module of the form.

 

GetEditedText()

 

This function returns the string of the edit box that has the focus.

 

GetEditedStr()

 

This function returns the id of the record in a foreign key's edit box that has the focus.

 

GetEditedName()

 

This function returns the name of the edit box that has the focus.

 

PrintGrid()

 

This procedure prints the records of a form that is in recordset browsing mode.

 

SetCaption  ( capt )

 

This procedure sets the caption of the form that has the focus as capt.

 

SetBtnCaption ( bname, capt )

 

This procedure sets the caption of the button with name bname as capt (in the form that has the focus)

 

SetApplCaption ( capt )

 

This procedure sets the caption of the application as capt.

 

message_yes_no ( msg )

 

This function returns (1) if the user presses "Yes" of (0) if the user presses "No" in a form that opens before him/her with a message msg.

 

CbLoad

ReLoadEditFields

PreviewAscii

Print

PrintPageFit

PrintAscii

SetLocator

DisableLocators

SetErrorFlag

SetDebugOnErrorFlag

ProgBarRange

ProgBarStepBy

ProgBarPosition

ProgBarVisible

TAddLine_sl

TDeleteAll_sl

GetDrawCell

FByName

TSelCount ( dgroup )
This function returns the count of the selected rows in the Datagroup (dgroup)

TSelUField ( dgroup )
This function returns the unique field's name of the DataGroup (dgroup)

TSelValue ( dgroup, offset )
This function returns the unique field value of the Datagroup (dgroup) at (offset).

example:

count = TSelCount(p)
for i = 1 to count
    uvals[i] = TSelValue(p,i)
next

SetScreenCursor

FormTask

GetApplication

GetErrorFlag

GetErrorMsg

GetInfo

getfprevfield

AdjustPanelRow