Skriptovací jazyk - funkce
Z K.A.P.
Verze z 26. 11. 2012, 12:52, kterou vytvořil Greplová Alena (diskuse | příspěvky)
| Funkce | Popis | |
| Function DelAll(s: String) : String | Do skriptovacího jazyka doplněny funkce zajišťující kompatibilitu s množinou funkcí dostupnou v rámci vyhodnocování výrazů v jiných částech programu (např. generátor sestav,filtrování pomocí výběrových podmínek). Syntaxe je stejná nebo obdobná. | |
| Function DelLeft(s: String) : String | ||
| Function DelRight(s: String) : String | ||
| Function EnumStr(s: String; Index: integer; Delimiter:Char = '/‘) : String | ||
| Function GetVar(VarName: String) : String | ||
| Function Left(s: String; Count: Integer) : String | ||
| Function Len(s: String) : Integer | ||
| Function Mid(s: String; Index, Count: Integer) : String | ||
| Function PosUp(SubStr, Source: String) : Integer | ||
| Procedure SetVar(Name: String; Value: Variant) | ||
| Function Str(Num: Extended; Size, Decimal: integer) : String | ||
| Function Right(s: String; Count: Integer) : String | ||
| Function Using(s: String, Size: Integer) : String | ||
| Function Val(s: String) : Extended | ||
| Function WinFmt(s: String) : String | ||
| Function DateValue(Datum: String):Integer | ||
| Function DV(Datum: String):Integer | ||
| Function StrDate(Datum: Integer):String | ||
| Function Abs(e: Extended): Extended | ||
| Function Trim(s: String): String | ||
| Function Conv(s: String; CP: Byte) : String | Převede text v kódování Windows do jiné kódové stránky.
Hodnoty pro CP: | |
| 0 | ASCII | |
| 1 | Kamenický (CP 895) | |
| 2 | ASCII2 (ASCII s rámečky) | |
| 3 | LATIN2 (CP 852) | |
| 4 | Windows 1250 | |
| Function Date: TDateTime | Vrací hodnotu aktuálního data (jako číslo). | |
| Function Time: TDateTime | Vrací hodnotu aktuálního času (jako číslo). | |
| Function Now: TDateTime | Vrací hodnotu aktuálního data a času (jako číslo). | |
| Function IfS(Condition: Boolean; IfTrue, IfFalse: String) : String | Funkce vyhodnotí podmínku, pokud bude hodnota True, tak vrátí text z parametru IfTrue, při False vrátí text z IfFalse. Parametry IfTrue, IfFalse i výsledek funkce jsou typu string | |
| Function IfL(Condition: Boolean; IfTrue, IfFalse: Integer) : Integer | Funkce vyhodnotí podmínku, pokud bude hodnota True, tak vrátí číslo z parametru IfTrue, při False vrátí číslo z IfFalse. Parametry IfTrue, IfFalse i výsledek funkce jsou typu celé číslo. | |
| Funkce | Popis |
| Function IniReadString(Sekce: String; Promenna: Byte; TestUzivatel: Boolean; Sklad: integer; Default: String): String | vrací textovou hodnotu proměnné z CISELNIK.BTR (číselník 161) |
| Function IniWriteString(Sekce : String; Promenna : Byte; TestUzivatel: Boolean; Sklad: integer; Hodnota: String): Boolean | zapisuje hodnotu proměnné (TestUzivatel=true: platí jen pro akt.uživatele; Sklad=0:platí pro všechny sklady) |
| Function IniReadInteger(Sekce : String; Promenna : Byte; TestUzivatel: Boolean; Sklad: integer; Default: integer): integer | vrací číselnou hodnotu proměnné |
| Function IniWriteInteger(Sekce : String; Promenna : Byte; TestUzivatel: Boolean; Sklad: integer; Hodnota: integer): Boolean | zapisuje číselnou hodnotu proměnné |
| Procedure LogWrite(Msg : String) | zapisuje informaci Msg do textového logu aplikace |
Příklad skriptu v syntaxi Pascal:
var i: integer;
s: String;
begin
s:=IniReadString('ScriptTest', 1, True, _AktualniSklad_, '5');
ShowMessage(Settings.Values['INI.FirmaJmeno']+chr(13)+Settings.Values['USER.JmenoUziv']+chr(13)+_KonfigDir_);
LogWrite('Direktivy:'+_Direktivy_);
if s <> then
i := StrToInt(s)+1
else
i := -10;
if not IniWriteInteger('ScriptTest', 1, True, _AktualniSklad_, i) then
ShowMessage('V IniWriteInteger se vyskytla chyba');
end.