![]() |
Delphi and Text input
hi, regarding my previews post iam trying to submit youtube links to other form i done with every thing but one thing has left ,, i want to allow only youtube links to be sent like only youtube links can be submitted i try method to force the text input to have more than 33 chars like this
Delphi-Quellcode:
basically this well force to insert text longer than 33 length but thats not the goal ,, is there any function to check if there is youtube url or not ?
begin
if Length(Trim(Textinput.Text)) < 33 then begin Application.MessageBox('Thats not youtube link', 'Info!', mb_iconWarning); end |
AW: Delphi and Text input
Maybe if the text starts with
|
AW: Delphi and Text input
Zitat:
Delphi-Quellcode:
but i got Thats not youtube link all the way cant send
if Length(Trim(textinput.Text)) < 33 then
begin Application.MessageBox('Thats not youtube link', 'Info!', mb_iconWarning); end else if AnsiStartsStr('http://youtube.com', textinput.Text) then begin Application.MessageBox('Thats not youtube link', 'Info!', mb_iconWarning); end |
AW: Delphi and Text input
|
AW: Delphi and Text input
Zitat:
Delphi-Quellcode:
, why do you show the message? Show the message if it NOT starts with. Simple logic
http://youtube.com
|
AW: Delphi and Text input
Zitat:
here is full code
Delphi-Quellcode:
but always get Thats not youtube link :(
procedure mainform.buttonclick(Sender: TObject);
begin if Length(Trim(textinput.Text)) < 33 then begin Application.MessageBox('invalid Youtube link', 'Info!', mb_iconWarning); end else if not AnsiStartsStr('http://youtube.com', textinput.Text) then begin Application.MessageBox('Thats not youtube link', 'Info!', mb_iconWarning); end else begin MessageDlg('done', mtInformation, [mbOK],0); close; end; end; |
AW: Delphi and Text input
Sorry to hear that but I think your delphi is broken.
if this
Delphi-Quellcode:
and that
if not AnsiStartsStr('http://youtube.com', textinput.Text) then
begin Application.MessageBox('Thats not youtube link', 'Info!', mb_iconWarning); end;
Delphi-Quellcode:
Always shows the "Thats not youtube link" message, then your delphi must be broken.
if AnsiStartsStr('http://youtube.com', textinput.Text) then
begin Application.MessageBox('Thats not youtube link', 'Info!', mb_iconWarning); end; |
AW: Delphi and Text input
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:34 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz