Character Mode Cookbook: Difference between revisions

m
Added to Character Mode category
No edit summary
m (Added to Character Mode category)
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
=Keys and commands=
<source lang="vdf">
  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
</source>


  Promt commands
  Promt commands
Line 10: Line 14:
  dfrun ex
  dfrun ex
  dfruncon ex            with mouse support
  dfruncon ex            with mouse support
=Declaration=
==Properties and variables==
<source lang="vdf">
property integer piCount public 0
set piCount To (piCount(current_object)+1)
</source>
==Move==
local integer liNumber
<source lang="vdf">
move 0 To liNumber


  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
</source>


==Set/Get==
<source lang="vdf">
  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]
</source>


==Be aware of the difference==
<source lang="vdf">
Set A of object to B  A=B
Get A of object to B  B=A
Move A to B
</source>


  Set A to B  A=B
  You can only use Get and Set on properties
Get A to B  B=A


=Functions and Procedures=
<source lang="vdf">
  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")
</source>
  --------------
  --------------
  SET
  SET
Line 56: Line 84:


  get myFunc of (oObj(current_object)) "tmp string" to sAnswer
  get myFunc of (oObj(current_object)) "tmp string" to sAnswer
--------------
 
=Start "windows/console"=
<source lang="vdf">
  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"
</source>


=Content layout=
<source lang="vdf">
  --------------
  --------------
  /Answer.hdr
  /Answer.hdr
Line 91: Line 124:
  Send OpenAnswerForm to (oAnswer(current_object)) "test string"
  Send OpenAnswerForm to (oAnswer(current_object)) "test string"
  --------------
  --------------
</source>


=Reports=
<source lang="vdf">
  /oReportView1.SectionName
  /oReportView1.SectionName
     __________________________________________________________________________
     __________________________________________________________________________
Line 149: Line 185:
  end_procedure
  end_procedure


</source>
  ---------------------------------------------------------------
  ---------------------------------------------------------------


=Objects=
<source lang="vdf">
  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 196: Line 235:
                                                                  
                                                                  
  End_Object
  End_Object
</source>
An object can be of different types
Containers
  - Entry_View_Client  :
  - View_Client        :
  - ModalClient        : Needs UI and brakes the flow
Controles
  - Entry_Form        : Data Aware
  - Form              : Non Data Aware
  - List              : Non Data Aware
  - Table              : Data Aware
[[Category:Basics]]
[[Category:Cookbook]]
[[Category:DataFlex (Character Mode)]]