Character Mode Cookbook: Difference between revisions
m
using source tag
m (Console Mode Cookbook moved to Character Mode Cookbook) |
m (using source tag) |
||
Line 1: | Line 1: | ||
=Keys and commands= | =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 15: | Line 17: | ||
=Declaration= | =Declaration= | ||
==Properties and variables== | ==Properties and variables== | ||
<source lang="vdf"> | |||
property integer piCount public 0 | property integer piCount public 0 | ||
set piCount To (piCount(current_object)+1) | set piCount To (piCount(current_object)+1) | ||
</source> | |||
==Move== | ==Move== | ||
local integer liNumber | local integer liNumber | ||
<source lang="vdf"> | |||
move 0 To liNumber | 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== | ==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== | ==Be aware of the difference== | ||
<source lang="vdf" | |||
Set A of object to B A=B | Set A of object to B A=B | ||
Get A of object to B B=A | Get A of object to B B=A | ||
Move A to B | Move A to B | ||
</source> | |||
You can only use Get and Set on properties | You can only use Get and Set on properties | ||
=Functions and Procedures= | =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 74: | Line 86: | ||
=Start "windows/console"= | =Start "windows/console"= | ||
<source lnag="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= | =Content layout= | ||
<source lang="vdf"> | |||
-------------- | -------------- | ||
/Answer.hdr | /Answer.hdr | ||
Line 109: | Line 124: | ||
Send OpenAnswerForm to (oAnswer(current_object)) "test string" | Send OpenAnswerForm to (oAnswer(current_object)) "test string" | ||
-------------- | -------------- | ||
</source> | |||
=Reports= | =Reports= | ||
<source lang="vdf"> | |||
/oReportView1.SectionName | /oReportView1.SectionName | ||
__________________________________________________________________________ | __________________________________________________________________________ | ||
Line 168: | Line 185: | ||
end_procedure | end_procedure | ||
</source> | |||
--------------------------------------------------------------- | --------------------------------------------------------------- | ||
=Objects= | =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 216: | Line 235: | ||
End_Object | End_Object | ||
<7source> | |||
An object can be of different types | An object can be of different types |