|
function DeclineRoleNeeds:Boolean var LArr : TCLJSONArray; itemsJson : String; { //ShowMessage('Role: '+Role); try if( Role <> nil){ //ShowMessage('Role True: '+Role); Result = False; if (Role == 'Chef') { AssignRoleAsChef; itemsJson = Clomosy.CLParseJSON(JsonResponse, 'items'); LArr = TCLJSONArray.Create; LArr = TCLJSONArray.CreateFromJSON(itemsJson); CloseValuePnlVD(LArr); // ValuePnl.Visible = false; // Bütün + - butonlarını görünmez yapar. LArr.free; Result = True; // Miktar büyümeli ve pozisyon ayarlanmalı } else if( role=='Waiter') AssignRoleAsWaiter; else if (role =='Cashier') { AssignRoleAsCashier; vScroll.Margins.bottom = (MainForm.clHeight * 0.2979); // 250 / 839 ≈ 0.2979 //Cashier noteMemo.Visible=False; //cashier CompleteBtn.Margins.top = (MainForm.clHeight * 0.3814); // 320 / 839 ≈ 0.3814 //Cashier StateAndDateTimePnl.Margins.top = (MainForm.clHeight * 0.5721); // 480 / 839 ≈ 0.5721 //Cashier AmountPnl.Margins.top = (MainForm.clHeight * 0.1907); // 160 / 839 ≈ 0.1907//Cashier } else if (role == 'Boss') AssignRoleAsBoss; else { ShowMessage('Role is invalid'); Result = False; } //} except ShowMessage('DeclineRoleNeeds Error, Exception Class: '+LastExceptionClassName+' Exception Message: '+LastExceptionMessage); } } role string bir değişken ve ben nil kontrolü yapmak istiyorum ama Invalid typecast hatası alıyorum while (not hasAffected) { hasAffected = uWaiterAndChefDetails.DeclineRoleNeeds; }
bu şekilde kontrol ediyorum. Timer atamaktansa https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">
|