Page History
...
Command Name | Usage | Description | Example | Version |
---|---|---|---|---|
Left | Left(text, number of characters, result variable) | Assigns the specified number of characters to the result variable starting from the left of the given text. | Left(@barcode,5,@materialcode) | 1.0 |
Right | Right(text, number of characters, result variable) | Assigns the specified number of characters to the result variable starting from the right of the given text. | Right(@barcode,5,@materialcode) | 1.0 |
Mid | Mid(text, start, length, result variable) | Assigns the specified number of characters to the result variable starting from the initial character of the given text. | Mid(@barcode,5,4, @materialcode) | 1.0 |
Pos | Pos(searched value, json array or text, result variable) | Assigns the position of the searched value in a text or JSON array to the result variable. If searching is performed in the text, it shows the character position, if searching is performed in the JSON array, it shows which elements of the array it is. In the JSON object, the array name is expected to be "param". If the searched value is not found, "-1" returns as the result, if the operation is incorrect, the result is "ERR". | Pos("001","P001", @result) Result: 2 Pos("K03",{"param": ["K01","K02","K03"]}, @result) Result:3 | 1.0 |
TrimLeft | TrimLeft(text,length, result variable) | Deletes the specified length from the left of the given text. | TrimLeft(@barcode,5,@materialcode) | 1.0 |
PadRight | PadRight(text, length, character, result variable) | Adds the requested character in the specified length to the end of the given text. | PadRight("K01",5,"0", @result) Result: K0100000 | 1.0 |
Split | Split(text, bracket, result variable) | Divides the given text into parts by using the specified characters as brackets. Places the values in the breakdowns of the given result variable. | Split(@barcode, "-", @codes) Usage: @codes.1 | 1.0 |
SplitForm at | SplitFormat(text,format, result variable) | Divides the text into variables according to the given format. When defining the format, the numbers 1-9 represent the child elements of the variable to be generated. It transfers the parts marked as 1 to the 1st child element. - character refers to sections that will not be included in the result. * character is used at the beginning or at the end. If it is used, the remainder of the format length is transferred to the 10th lower element. If it is used at the beginning, the part of the text in the specified format on the right is processed. The remaining is transferred to the 10th child element. | SplitFormat ("NS140271.98", "--111111-22", @result) @result.1 = 140271 @result.2 = 98 SplitFormat ("123456999", "111222*",@result) @result.1 = 123 @result.2 = 456 @result.10 = 999 | 1.0 |
SplitRegex | SplitRegex(text, regex format, result variable) | Divides the given text into result variables according to the requested Regular Expression. The used Regular Expression must be defined correctly. Each parenthesis used in the Regular Expression outputs a child element of the variable. | SplitRegex("SNO-AAA- 001","SNO-([A-Z]{3})[-.] (\d+)",@result) @result.1 = AAA @result.2 = 001 | 1.0 |
Değişken. IsNumber | variable.IsNumber | Specifies whether the given variable is a number. If it is a number, it returns 0; if not, it returns -1. | If(@code.IsNumber="0", Goto(Detay),Goto (Error)) | 1.0 |
Değişken. IsDate | variable.IsDate | Specifies whether the given variable is a date. If it is in date format, it returns 0; if it is not, -1. | If(@code.IsDate="0", Goto(Detay),Goto (Error)) | 1.0 |
Değişken. IsAlpha | variable.IsAlpha | Specifies whether the given variable (consisting of letters and numbers) is an alphanumeric value. If the format is appropriate it returns 0; if not, -1. | If(@code.IsAlpha="0", Goto(Detay),Goto (Error)) | 1.0 |
Değişken. Base64 | variable.Base64 | Converts the value of the given variable to Base64. | Text(1,1, @materialcode. Base64) | 1.2 |
Today | Today(date format, result variable) | Assigns the current date to the result variable in accordance with the given format. This document can be used for date formats that can be used. | Today("dd.MM.yyyy", @today) | 1.0 |
Now | Now(date format, result variable) | Assigns the current date and time information to the result variable in accordance with the given format. This document can be used for date formats that can be used. | Now("hh:mm",@now) | 1.0 |
FormatDate | FormatDate(day,month,year,format,result variable) | Creates a date in the specified format with the given day/month/year values. If the appropriate values for the date are not given, the -1 value returns. | FormatDate(1,1,2000," yyyy-MM-dd",@date) | 1.0 |
FormatDateTime | FormatDateTime(day, month, year,hour, minute, second,format,result variable) | Creates a date in the specified format with the given day/month/year/minute/second values. If the appropriate values for the date are not given, the -1 value returns. | FormatDateTime (1,1,2000,12,12,0," yyyy-MM-dd hh:mm", @date) | 1.0 |
İşleyiş Komutları
Run Commands
Komut Adı | Kullanım Şekli | Açıklama | Örnek Kullanım | Eklendiği SürümCommand Name | Usage | Description | Example | Version |
---|---|---|---|---|---|---|---|---|
BeginForm /EndForm | BeginForm(Form adıname) EndForm() | Script içinde yeni bir It is used to define a new form(bölüm) tanımı yapmak için kullanılır. Form adında Türkçe karakterler kullanılmazsection) in the script. Turkish characters are not used in the form name. | BeginForm(Giris) Text(1,1,"Hoşgeldiniz") EndForm() | 1.0 | ||||
GoForm | GoForm(Form adı)Scriptin işleyişini belirtilen forma yönlendirir. Sonraki akış gidilen formun içinde tarif edilmelidirname) | Directs the operation of the script to the specified form. The next flow should be described in the target form. | GoForm(SiparisKabul) | 1.0 | ||||
CallForm ReturnForm | CallForm(Form adıname) ReturnForm() | Scriptin işleyişini belirtilen forma yönlendirir ve gidilen formda ReturnForm() satırını gördüğünde, çağıran formda kalınan satıra geri döner. | CallForm(Kontrol) Text(1,1,@kontrolsonucu) BeginForm(Kontrol) Set(@kontrolsonucu, 1+1) ReturnForm() EndForm() | 1.0 | ||||
SetReturnLine ReturnLine | SetReturnLine() ReturnLine() | Bir formun içinde scriptin işleyişini değiştirmek için kullanılır. SetReturnLine() komutunun verildiği satır işaretlenir, form içinde başka bir yere işlem yönlendirildikten sonra ReturnLine() komutunu gördüğünde işaretlenmiş satıra döner. | SetReturnLine() if(@kontrolsonucu="",Goto(kontrol),Goto (devam)) ... kontrol: Set(@kontrolsonucu, 1+1) ReturnLine() | 1.0 | ||||
KeyFunction | KeyFunction(tuş adıbutton name, komut) | Klavyedeki tuşlara komut atama yapmak için kullanılır. Tuş parametresi olarak, fonksiyon tuşları ya da It is used to assign commands to the keys on the keyboard. As a key parameter, the function keys or the ESC, TAB, DEL tuşları çift tırnak içinde yazılabilirkeys can be written between double quotes. (Ör. For example: "F1", "TAB","ESC","DEL")Komut parametresi olarak, basit STC komutlarının tamamı (parametresiz ya da tek parametreli) As a command parameter, all simple STC commands (without parameters or with one parameter) can be used. (For example: Goto(tag), ClrScr(), Beep(), GoForm(form), CallForm(form)) | KeyFunction("ESC",GoForm(SiparisKabul)) | 1.0 | ||||
Goto | Goto(etiket adıtag name) | Bir form içinde işleyişi belirtilen etikete yönlendirmek için kullanılırIt is used to redirect the operation in a form to the specified tag. | if(@deger="1",Goto(kontrol),Goto(devam)) | 1.0 | ||||
CaseGoto | CaseGoto(değişken adıvariable name,JSON) | Verilen değişkenin değerine bağlı olarak belirtilen etikete gidilmesini sağlar. Değişkenin değeri ve gidilecek etiketin info JSON biçiminde tanımlanırNavigates to the specified tag by the value of the given variable. The value of the variable and the info of the target tag are defined in JSON format. | CaseGoto(@result,{"0":"LotGiris","1":" 1.0 MiktarGiris"}) | 1.0 | ||||
If/Else/EndIf | If(koşul, komut, komut) If(koşul, komut) If(koşul) Else() EndIf() | Belirtilen koşula bağlı olarak işleyişi yönlendirir. Koşul bölümü AND/OR operatörlerini ve It maintains the running by the specified condition. The condition section contains the AND/OR operators and supports > < >= <<= != işaretlerini desteklersigns. İki şekilde kullanılırIt can be used as follows: 1- Tek satırda kullanıldığında, hem koşul hem de işletilecek komutlar belirtilir. Komut bölümlerinde parametre içermeyen ya da tek parametre içeren herhangi bir STC komutu yazılabilir. Etiketlere gitme özelliği GOTO komutuyla yapılır. 2- Else ve EndIf ile birlikte kullanıldığında yapılacak işlemler ilgili kod blokları arasına yazılabilir. İç içe If blokları oluşturulabilir. Tek satırda, tek komut parametresiyle çalışan şekli (if,komut) 1.2 sürümüyle eklenmiştirWhen used in a single line, both the condition and the commands to be executed are specified. An STC command that does not contain parameters or contains a single parameter can be written in the command sections. The GOTO command is used to go to tags. 2- When used with Else and EndIf, the operations to be performed can be written between the related code blocks. The nested If blocks can be created. The type, which works on a single line with a single command parameter (if,command) was added in version 1.2. | If(@fisturu=1,Clrscr(),Goto(Error)) 1.0 If(@result > 5 AND @result < 10,Goto(Sec), Goto(Sil)) If(@fisturu=1,Goto(Error)) // v1.2 den itibaren If(@result=1) Text(1,1,"Error") Else() Text(1,1,"TAMAM") EndIf() | 1.0 | ||||
For/Next | For(değişken adıvariable name, başlangıç, bitiş, artış) Next() | Döngü ile işlem yapılmasını sağlar. Verilen değişken, döngü sırasında belirtilen artışa göre otomatik olarak değer alır. Döngü bittiğinde, değişken silinir. Eğer bir scriptte For komutu tanımlandıysa, Next() komutuna kadar bütün komutlar belirtilen sayıda tekrarlanır. İç içe FOR döngüleri oluşturulabilir. | For(@i,1,10) Text(1,@i,@[email protected]_name) Next() | 1.0 | ||||
ResetVariables | ResetVariables() ResetVariables(JSON) | Hafızadaki değişkenleri temizler. Tüm hafıza değişkenlerini ya da sadece istenen değişkenleri boşaltabilir, istenen değişkenler hariç tutulabilir. Bu komut, oturum boyunca geçerli olması gereken değişkenleri boşaltmaz. (Ör: @@Style) JSON biçimindeki parametrelerde aşağıdaki anahtarlar kullanılabilir: name : Özellikle temizlenmek istenen değişkenin adı except : Hariç tutulacak değişkenler Her iki anahtar için de, hem tek değer hem de bir dizi verilebilir. | ResetVariables() // tüm değişkenleri boşaltır ResetVariables({"name": "@CurrentItem"}) // tek bir değişkeni boşaltır ResetVariables({"name": ["@CurrentItem", "@AR/APquery"]}) // sadece belli değişkenleri boşaltır ResetVariables({ "except" : ["@AR/APquery", "@depo"] }) //belli değişkenler dışındakileri boşaltır LogVariables() | 1.0 | ||||
LogVariables | LogVariables() | Terminal sunucu hafızasındaki kullanıcı oturumuna ait tüm değişkenleri log tablosuna/dosyasına json biçiminde yazar. Değişkenlerin hangi kullanıcı oturumuna ait olduğu da logda yer alır. | LogVariables() | 1.0 | ||||
Print(rapor adı,yazıcı sıra no,kopya sayısı, parametreler) | Tanımlanmış rapor dosyalarının yazıcıdan yazdırılmasını sağlar. Rapor adı : Kullanıcı tanımlı raporun adı Yazıcı sıra no: SYS'de Yazıcı Tanımlarında yazıcıya ait sıra numarasıdır. 0 yazılırsa kullanıcıya tanımlı yazıcı seçilir. Kopya sayısı: Raporun kopya sayısı parametreler: Rapor içinde kullanılan parametrelere değerlerinin gönderildiği kısım. json formatında yazılır. | Print("Fis_Rapor",0,1, {"fis_id": @fisid,"document_no" : "@documentno"}) | 1.0 | |||||
Sql | Sql(metin olarak query,sonuç değişkeni) Sql({"report": "query raporu adı", "param1" :"değer1" }, sonuç değişkeni) | Veritabanında belirtilen metin ya da rapor querysunu çalıştırır. Dönen değerleri sonuç değişkenine yazar. İki şekilde kullanılabilirRuns the text or report queries specified in the database. It writes the returning values to the result variable. It can be used as follows: 1- Metin querylar Text queries: query metni çift tırnak içinde yazılırThe query text is written between double quotes. 2- Kullanıcı tanımlı raporlar : JSON biçiminde çalıştırılacak rapor ve rapora gönderilecek parametreler tanımlanır. Sonuç değişkeninde aşağıdaki info bulunur: rowCount : querydan dönen kayıt sayısı rows: querydan dönen kayıtların listesi. Bu listede, 1 den başlayarak satır değerlerine ulaşılabilirUser-defined reports: The report to be executed in JSON format and the parameters sent to the report are defined. The result variable has the following info: rowCount: the number of records returned from the query rows: list of records returned from the query. In this list, row values starting from 1 can be accessed. | Sql("SELECT COUNT(*) as SAYI from WorkOrderLine With(NOLOCK) where SlipId=@@WorkOrder.Id",@LineNumber) Sql({"report":"LotControl","TrackingNumber":" @LotNo"},@result) If(@result.rowCount = 0) Goto(Error) Else() Text(1,1,"@result.rows.1.Name") EndIf() | 1.0 | ||||
Login | Login(kullanıcı adı, şifre)Uygulamaya giriş | yapmak için kullanılır. Sadece Telnet el terminallerinde ve gerekli olduğu durumlarda kullanılmalıdır. Terminal parametrelerinde "kullanıcı yetkilendirmesi" özelliği açıksa, bir işlem yapmazIt is used to log in to the application. It should only be used on Telnet handheld terminals and when necessary. If the "user authorization" feature is turned on in the terminal parameters, it will not perform an operation. | Login("ali", "1") | 1.0 | ||||
Logout | Logout() Uygulamada | açık olan kullanıcı oturumunu kapatmak için kullanılırIt is used to close the user session that is open in the application. | Logout() | 1.0 | ||||
Http | Http(metot, url, headerJSON bodyJSON, @result)Script içinden | It allows a REST API call in the script. method: GET, POST, PUT values. url: Info of the API address to be connected. It can start with http or https. If the operation to be executed involves the use of "url query string" bodyJSON: Http isteğine değer olarak gönderilecek info JSON biçiminde girilir. sonuc: Yapılan isteğin sonucunda dönen info bu değişkene yazılır. Komutun sonucunda 200 cevabı geldiğinde result değeri olarak 0, diğer durumlarda -1 değeri yazılır. Message değeri olarak verilen Error infosi yazılır, the related parameter values are given in the url. headerJson : The information for the header information of the http request is entered in JSON format. It can be used for information such as basic authentication or JWT token. bodyJSON: The information to be sent as the value of the http request is entered in JSON format. result: The information returned as a result of the request is written to this variable. When the result of the command is 200, the result value is written as 0, in other cases, it is -1. The Error information given as the Message value is written. | Set(@userinfo, "@username:@password") Set(@header, {"Content-Type":"application /json", "Authorization":"Basic @userinfo. base64"}) Set(@body, {"firmno":"@company", "sessionId":" @id"}) Http("POST","http://server.com/api/v1 /token", @header,@body,@result) //Query string Http("GET","http://server.com/api/v1/Items? code=@code", @header,,@result) | 1.0 |
...