AndrewShanklin
asked on
Simple question: find variable in edit1.text = ?????/
Hi,
I've got a quick question:
I have on a form:
Edit1
Edit2
Button1
label1
The text in Edit1 is: User Field 1://Variable/...
User Field 1://
and
/...
remain constant throughout
However "Variable" always equals Edit2.text
So for example you could have:
Edit2.text := Andy
Edit1.text: User Field 1://Andy/...
I need to simply parse the variable in Edit1
So on button1.click --> label1.caption := the variable from edit1.text ie, Andy.
Obviously you cant just have label1.caption := Edit2.text it has to parse Edit1
If you can help please provide a full souce code snippet - it helps us all!
Many thanks
Andy.
I've got a quick question:
I have on a form:
Edit1
Edit2
Button1
label1
The text in Edit1 is: User Field 1://Variable/...
User Field 1://
and
/...
remain constant throughout
However "Variable" always equals Edit2.text
So for example you could have:
Edit2.text := Andy
Edit1.text: User Field 1://Andy/...
I need to simply parse the variable in Edit1
So on button1.click --> label1.caption := the variable from edit1.text ie, Andy.
Obviously you cant just have label1.caption := Edit2.text it has to parse Edit1
If you can help please provide a full souce code snippet - it helps us all!
Many thanks
Andy.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As you know the length of the Prefix part (User Field 1://) that is 15 you could simply do:
Label1.Capiton := Copy(Edit1.Text,16,pos('/. ..',Edit1. Text)-16);
Label1.Capiton := Copy(Edit1.Text,16,pos('/.
ASKER
Many thanks
A.
A.
Var
Tmp: String;
begin
Tmp:=Edit1.Text;
Delete(Tmp,1,Pos('//',Edit
Tmp:=Copy(Tmp,1,Pos('/',Tm
Label1.Caption:=Tmp;
end;
I think you mean that, i am half asleep right now.