Do not let any software impress you!

Only let it convince your intellect.
Slider img 1
Do not look for a business paradise!

It is a waste of time.
Slider img 2
Only yourself can push you uphill.

There is no easy road to prizes.
Slider img 3
Productivity is the name of the game.

And you have to conquer it.
Slider img 4
As long as you understand it,

you will start to build your know-how.
Slider img 5
We can help with that.

We have the tools and the method.
Slider img 6

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,�=USER_ID“)   ‘...the value for the user id is 100

  call OpenForm(ptDelete,“USER1.FM“,“WORK.USERTABLE“,1,�=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 asks if the form will close. If stay_flag is (1), the form saves to the database and stays opened and blank for the following data to append. 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. We must have the searched form already opened.

       FByResName ( fname )


This function returns the handle of the form that has resource name fname. We must have the searched form 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 opens. 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 to 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. That is applied when we store small chucks of data in 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. That is applied when we store small chucks of data to local files than in the database. We must have saved the ini file previously with the SaveFormToIni.

       BrowseFirst()


This procedure advances the current form (in the case of the report) on 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 the case of the report) on 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 the report‘s case) on 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 the report‘s case) on the previous 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 following 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 we have copy previously with a CopyTrans. Thus, those procedures have meaning only in the forms of the same recodset(s).

       message ( p1, p2, ... )


This procedure shows the message that is the concatenation of p1, p2, .... If we call the procedure inside an HTML file, then the message outputs the concatenated string to the HTML file.

       SetFixedRows ( count )


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

       SetFixedCols ( count )


This procedure sets as count the fixed columns (starting from the beginning) 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 the variable named varname. We use this function 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 record‘s id 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 them with a message msg.


       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