merhaba aşağıdaki kodda en son satırda anlamlandıramadığım bir sytanx error alıyorum şimdiden yardımlarınız için teşekkür ederim
var KayitForm: TclStyleForm; nameEdit, surnameEdit, emailEdit, passwordEdit: TclProEdit; kayitButton: TClProButton; titleLabel: TClProLabel;
function IsValidAndUniqueEmail(mail: String): Boolean; var atPos, dotPos, adetInt: Integer; { atPos = Pos('@', mail); dotPos = Pos('.', mail);
if (atPos <= 1 || dotPos <= atPos + 1 || dotPos >= Length(mail)) { ShowMessage('Geçerli bir e-posta adresi giriniz.'); Result = False; exit; }
try Clomosy.DBSQLiteQuery.SQL.Text = 'SELECT COUNT(*) as adet FROM Users WHERE Email = ' + QuotedStr(mail);
Clomosy.DBSQLiteQuery.Open; adetInt = 0; if not Clomosy.DBSQLiteQuery.Eof adetInt = Clomosy.DBSQLiteQuery.FieldByName('adet').AsInteger;
Clomosy.DBSQLiteQuery.Close;
if (adetInt > 0) { ShowMessage('Bu e-posta adresi zaten kayıtlı.'); Result = False; } else { Result = True; }
except ShowMessage('Exception class: ' + LastExceptionClassName + ' Exception Message: ' + LastExceptionMessage); Clomosy.DBSQLiteQuery.Close; Result = False; } }
function CheckBlanks: Boolean; { if (Trim(nameEdit.Text) == '' || Trim(surnameEdit.Text) == '' || Trim(emailEdit.Text) == '' || Trim(passwordEdit.Text) == '') { ShowMessage('Lütfen tüm alanları doldurun.'); Result = False; } else { Result = True; } }
void ResetFields; { nameEdit.Text = ''; surnameEdit.Text = ''; emailEdit.Text = ''; passwordEdit.Text = ''; }
void KayitOl; { if (CheckBlanks && IsValidAndUniqueEmail(emailEdit.Text)) { Clomosy.DBSQLiteQuery.SQL.Text = 'INSERT INTO Users (Email, FirstName, LastName, Password) VALUES (' + QuotedStr(emailEdit.Text) + ',' + QuotedStr(nameEdit.Text) + ',' + QuotedStr(surnameEdit.Text) + ',' + QuotedStr(passwordEdit.Text) + ')';
try Clomosy.DBSQLiteQuery.OpenOrExecute; ShowMessage('Kayıt başarıyla tamamlandı.'); ResetFields; except ShowMessage('Exception class: ' + LastExceptionClassName + ' Exception Message: ' + LastExceptionMessage); } }
{ KayitForm = TclStyleForm.Create(Self); KayitForm.SetFormBGImage(' https://i.imgur.com/XYlUQhl.jpeg" rel="nofollow - https://i.imgur.com/XYlUQhl.jpeg ');
titleLabel = KayitForm.AddNewProLabel(KayitForm, 'titleLabel', 'Kayıt Ol'); titleLabel.Align = alTop; titleLabel.Height = 40; titleLabel.clProSettings.FontSize = 20; titleLabel.clProSettings.TextSettings.Font.Style = [fsBold]; titleLabel.clProSettings.TextSettings.FontHorzAlign = palCenter; titleLabel.SetclProSettings(titleLabel.clProSettings);
nameEdit = KayitForm.AddNewProEdit(KayitForm, 'nameEdit', 'Adınız'); nameEdit.Align = alTop; nameEdit.Height = 40; nameEdit.Margins.Top = 20;
surnameEdit = KayitForm.AddNewProEdit(KayitForm, 'surnameEdit', 'Soyadınız'); surnameEdit.Align = alTop; surnameEdit.Height = 40; surnameEdit.Margins.Top = 10;
emailEdit = KayitForm.AddNewProEdit(KayitForm, 'emailEdit', 'E-posta adresi'); emailEdit.Align = alTop; emailEdit.Height = 40; emailEdit.Margins.Top = 10;
passwordEdit = KayitForm.AddNewProEdit(KayitForm, 'passwordEdit', 'Şifre'); passwordEdit.Align = alTop; passwordEdit.Height = 40; passwordEdit.Password = True; passwordEdit.Margins.Top = 10; passwordEdit.SetclProSettings(passwordEdit.clProSettings);
kayitButton = KayitForm.AddNewProButton(KayitForm, 'kayitButton', 'Kayıt Ol'); kayitButton.Align = alTop; kayitButton.Height = 45; kayitButton.Margins.Top = 20; kayitButton.clProSettings.TextSettings.Font.Style = [fsBold]; kayitButton.clProSettings.FontHorzAlign = palCenter; kayitButton.SetclProSettings(kayitButton.clProSettings); KayitForm.AddNewEvent(kayitButton, tbeOnClick, 'KayitOl');
KayitForm.Run; }
|