Character Mode Cookbook: Difference between revisions
From DataFlex Wiki
Jump to navigationJump to search
New page: on_key KCLEAR : F5 on_key KCANCEL Send Cancel : Esc on_key KENTER : Enter on_key KSAVE_RECORD Send Do_Report : F2 Promt commands df32 dfc... |
No edit summary |
||
Line 1: | Line 1: | ||
on_key KCLEAR : F5 | on_key KCLEAR : F5 | ||
on_key KCANCEL Send Cancel : Esc | on_key KCANCEL Send Cancel : Esc | ||
on_key KENTER : Enter | on_key KENTER : Enter | ||
on_key KSAVE_RECORD Send Do_Report : F2 | on_key KSAVE_RECORD Send Do_Report : F2 | ||
Promt commands | Promt commands | ||
df32 | df32 | ||
dfcomp ex.src -pfv1 p=precompile | dfcomp ex.src -pfv1 p=precompile | ||
dfcomp ex.src -fv1 fv1 creates prn-file (check errors) | dfcomp ex.src -fv1 fv1 creates prn-file (check errors) | ||
dfrun ex | dfrun ex | ||
dfruncon ex with mouse support | dfruncon ex with mouse support | ||
Move (key+1) to key key = key++ //Dont forget to use paratheses (a+(b*c))<>a+b*c | Move (key+1) to key key = key++ //Dont forget to use paratheses (a+(b*c))<>a+b*c | ||
Set value of (oPop(current_object)) item 0 to sVar // item[0] = sVar | Set value of (oPop(current_object)) item 0 to sVar // item[0] = sVar | ||
Get Value item 0 to sVar // sVar = item[0] | Get Value item 0 to sVar // sVar = item[0] | ||
Set A to B A=B | Set A to B A=B | ||
Get A to B B=A | Get A to B B=A | ||
get myFunc of (oObj(current_object)) "tmp" to sAnswer // sAnswer = oObj->myFunc("tmp") | get myFunc of (oObj(current_object)) "tmp" to sAnswer // sAnswer = oObj->myFunc("tmp") | ||
-------------- | -------------- | ||
SET | SET | ||
value of OBJ ITEM to VAL | value of OBJ ITEM to VAL | ||
location X Y [ABSOLUTE/RELATIVE] | location X Y [ABSOLUTE/RELATIVE] | ||
focus_mode to POINTER_ONLY | focus_mode to POINTER_ONLY | ||
-------------- | -------------- | ||
Procedure MyProcedure | Procedure MyProcedure | ||
End_Procedure | End_Procedure | ||
Send MyProcedure | Send MyProcedure | ||
------------------ | ------------------ | ||
Procedure DisplayResult String lsValue1 String lsValue2 String lsValue3 | Procedure DisplayResult String lsValue1 String lsValue2 String lsValue3 | ||
set value of (oOutput(self)) item 0 to lsValue1 | set value of (oOutput(self)) item 0 to lsValue1 | ||
set value of (oOutput(self)) item 1 to lsValue2 | set value of (oOutput(self)) item 1 to lsValue2 | ||
set value of (oOutput(self)) item 2 to lsValue3 | set value of (oOutput(self)) item 2 to lsValue3 | ||
end_procedure | end_procedure | ||
send DisplayResult lsValue1 "" "" | send DisplayResult lsValue1 "" "" | ||
-------------- | -------------- | ||
Procedure_Section // used in reports to handle paging in a smarter way | Procedure_Section // used in reports to handle paging in a smarter way | ||
-------------- | -------------- | ||
Function MyFunction integer i returns Integer | Function MyFunction integer i returns Integer | ||
End_Function | End_Function | ||
get MyFunction(self) as iRet | get MyFunction(self) as iRet | ||
-------------- | -------------- | ||
function myFunc string test returns string | function myFunc string test returns string | ||
local string lsRval | local string lsRval | ||
move test to lsRval | move test to lsRval | ||
function_return lsRval | function_return lsRval | ||
end_function | end_function | ||
get myFunc of (oObj(current_object)) "tmp string" to sAnswer | get myFunc of (oObj(current_object)) "tmp string" to sAnswer | ||
-------------- | -------------- | ||
start_ui // starts a new console | start_ui // starts a new console | ||
ui_accept // has a return value | ui_accept // has a return value | ||
activate_scope // opens a new "window" | activate_scope // opens a new "window" | ||
-------------- | -------------- | ||
/Answer.hdr | /Answer.hdr | ||
+--------------------+ | +--------------------+ | ||
/Answer.dat | /Answer.dat | ||
¦ Answer:_________ ¦ | ¦ Answer:_________ ¦ | ||
+--------------------+ | +--------------------+ | ||
/* | /* | ||
register_object oAnswer | register_object oAnswer | ||
Object oAnswer is a Client Answer.hdr | Object oAnswer is a Client Answer.hdr | ||
Set location 7 30 ABSOLUTE | |||
On_Key kcancel Send cancel | |||
Object oAnswData is a Form Answer.dat | Object oAnswData is a Form Answer.dat | ||
Line 87: | Line 87: | ||
End_Procedure | End_Procedure | ||
End_Object | End_Object | ||
Send OpenAnswerForm to (oAnswer(current_object)) "test string" | Send OpenAnswerForm to (oAnswer(current_object)) "test string" | ||
-------------- | -------------- | ||
/oReportView1.SectionName | /oReportView1.SectionName | ||
__________________________________________________________________________ | |||
/oReportView1.body | /oReportView1.body | ||
____________________ ______________________ | ____________________ ______________________ | ||
/* | /* | ||
//Activate_View Activate_Report1 for oReportView | //Activate_View Activate_Report1 for oReportView | ||
Object oReportView1 is a Report_View NO_IMAGE | Object oReportView1 is a Report_View NO_IMAGE | ||
Object oMainReport is a seq.Report NO_IMAGE | Object oMainReport is a seq.Report NO_IMAGE | ||
Line 143: | Line 143: | ||
send run_report to (oMainReport(self)) | send run_report to (oMainReport(self)) | ||
End_Procedure | End_Procedure | ||
End_Object | End_Object | ||
procedure Activate_Report_View_1 | procedure Activate_Report_View_1 | ||
send run_report to (oReportView1(self)) | send run_report to (oReportView1(self)) | ||
end_procedure | end_procedure | ||
--------------------------------------------------------------- | --------------------------------------------------------------- | ||
Object oOrder is a Entry_View_Client oOrder.hdr | Object oOrder is a Entry_View_Client oOrder.hdr | ||
Set location 5 8 ABSOLUTE | Set location 5 8 ABSOLUTE | ||
Line 195: | Line 195: | ||
End_Object | End_Object | ||
End_Object | End_Object |
Revision as of 14:04, 17 August 2007
on_key KCLEAR : F5 on_key KCANCEL Send Cancel : Esc on_key KENTER : Enter on_key KSAVE_RECORD Send Do_Report : F2
Promt commands df32 dfcomp ex.src -pfv1 p=precompile dfcomp ex.src -fv1 fv1 creates prn-file (check errors) dfrun ex dfruncon ex with mouse support
Move (key+1) to key key = key++ //Dont forget to use paratheses (a+(b*c))<>a+b*c
Set value of (oPop(current_object)) item 0 to sVar // item[0] = sVar Get Value item 0 to sVar // sVar = item[0]
Set A to B A=B Get A to B B=A
get myFunc of (oObj(current_object)) "tmp" to sAnswer // sAnswer = oObj->myFunc("tmp") -------------- SET value of OBJ ITEM to VAL location X Y [ABSOLUTE/RELATIVE] focus_mode to POINTER_ONLY -------------- Procedure MyProcedure
End_Procedure
Send MyProcedure ------------------ Procedure DisplayResult String lsValue1 String lsValue2 String lsValue3 set value of (oOutput(self)) item 0 to lsValue1 set value of (oOutput(self)) item 1 to lsValue2 set value of (oOutput(self)) item 2 to lsValue3 end_procedure send DisplayResult lsValue1 "" "" -------------- Procedure_Section // used in reports to handle paging in a smarter way --------------
Function MyFunction integer i returns Integer End_Function get MyFunction(self) as iRet -------------- function myFunc string test returns string local string lsRval move test to lsRval function_return lsRval end_function
get myFunc of (oObj(current_object)) "tmp string" to sAnswer -------------- start_ui // starts a new console ui_accept // has a return value activate_scope // opens a new "window"
-------------- /Answer.hdr +--------------------+ /Answer.dat ¦ Answer:_________ ¦ +--------------------+ /* register_object oAnswer Object oAnswer is a Client Answer.hdr Set location 7 30 ABSOLUTE On_Key kcancel Send cancel
Object oAnswData is a Form Answer.dat Set location 1 0 RELATIVE Set focus_mode to POINTER_ONLY item_list On_Item "" Send none end_item_list End_Object
Procedure OpenAnswerForm string sValue local Integer iRval Set value of (oAnswData(current_object)) item 0 to sValue ui_accept current_object to iRval End_Procedure
End_Object
Send OpenAnswerForm to (oAnswer(current_object)) "test string" --------------
/oReportView1.SectionName __________________________________________________________________________ /oReportView1.body ____________________ ______________________ /*
//Activate_View Activate_Report1 for oReportView Object oReportView1 is a Report_View NO_IMAGE
Object oMainReport is a seq.Report NO_IMAGE
Set Main_File to customer.file_number //set Ordering to 2 // Order by name Set Report_Title to "Report 1 - Show position of sections"
set Page_End to 18 // Page length set to screen length
Procedure _PrintSectionName String lsValue Print lsValue to oReportView1.SectionName.1 Output_Pagecheck oReportView1.SectionName End_Procedure
// Procedures Page_Top thru Page_Bottom ONLY get used by the outermost report // object... All other objects delegate messages to this ultimate parent. // creating these procedures in child reports will have NO effect.
// Procedure_Section Page_Top as oReportView1.SectionName // Procedure_Section Report_Header as oReportView1.SectionName // Procedure_Section Page_Header as oReportView1.SectionName // Procedure_Section Page_Title as oReportView1.SectionName // Procedure_Section Page_Total as oReportView1.SectionName // Procedure_Section Page_Footer as oReportView1.SectionName // Procedure_Section Report_Footer as oReportView1.SectionName Procedure_Section Page_Bottom as oReportView1.SectionName Send _PrintSectionName "Page_Bottom (last thing printed on every page)" End_Procedure
Procedure_Section Body as oReportView1.body // or Procedure_Section Body Print customer.name to oReportView1.body.1 // Sets the data fields Print customer.city to oReportView1.body.2 Output_Pagecheck oReportView1.body // Prints the data to screen End_Procedure
//Procedure_Section Total as oReportView1.SectionName
End_Object
Procedure run_report send run_report to (oMainReport(self)) End_Procedure End_Object
procedure Activate_Report_View_1 send run_report to (oReportView1(self)) end_procedure
---------------------------------------------------------------
Object oOrder is a Entry_View_Client oOrder.hdr Set location 5 8 ABSOLUTE
Object Orderhea_DD is a Data_Set NO_IMAGE Set main_file to Orderhea.file_number End_Object
Object Orderdtl_DD is a Data_Set NO_IMAGE Set main_file to Orderdtl.file_number Send attach_server (Orderhea_DD(current_object)) //Set constrain_file to orderhea.file_number begin_constraints Constrain orderdtl relates to orderhea end_constraints End_Object Object oForm is a Entry_Form oOrder.frm Set location 1 0 RELATIVE Set Server to (Orderhea_DD(current_object))
item_list Entry_Item ORDERHEA.ORDER_NUMBER { AutoClear AutoFind } Entry_Item ORDERHEA.ORDER_DATE { AutoClear NoEnter } Entry_Item ORDERHEA.SHIP_VIA { AutoClear NoEnter } Entry_Item ORDERHEA.ORDERED_BY { AutoClear NoEnter } Entry_Item ORDERHEA.ORDER_TOTAL { AutoClear NoEnter } end_item_list End_Object
Object oList is a Selection_List oOrder.lst Set location 13 0 RELATIVE Set Server to (Orderdtl_DD(current_object)) Begin_Row Entry_Item ORDERDTL.DETAIL_NUMBER { AutoClear AutoFind NoPut} Entry_Item ORDERDTL.ITEM_ID { AutoClear } Entry_Item ORDERDTL.QTY_ORDERED { AutoClear } Entry_Item ORDERDTL.PRICE { AutoClear } Entry_Item ORDERDTL.EXTENDED_PRICE { AutoClear } End_Row
End_Object End_Object