| View previous topic :: View next topic |
| Author |
Message |
LinkSisco Valued Newbie
Joined: 17 May 2002 Posts: 30 Location: UK
|
Posted: Thu Sep 26, 2002 2:02 pm Post subject: VDS3 - List/Edit copying help |
|
|
Ok, here it is...
I have an edit box and a list box.
I want to use a button to copy all of the contents of the edit to the list and another button that will copy all thats in the list to the edit.
it must also overwrite everything in the list or edit box when replacing.
Thank you. |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Sep 26, 2002 2:21 pm Post subject: |
|
|
This is really quick and dirty. But it might help ya a step further.
| Code: | dialog create,test,-1,0,100,50
dialog add,edit,E1,1,1,90,20,edit contents
dialog add,list,lb,30,1,90,20,
list add,lb,list contents
dialog show
wait 3
%a = @text(lb)
%b = @dlgtext(E1)
dialog clear,E1
dialog set,E1,%a
list clear,lb
list add,lb,%b
wait 3 |
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
LinkSisco Valued Newbie
Joined: 17 May 2002 Posts: 30 Location: UK
|
Posted: Thu Sep 26, 2002 3:34 pm Post subject: |
|
|
Ok, thats ruffly what i already had, but like mine when its copied from the list abd put in the edit box its all on the same line, seperated by what look like black breakers.
how can i stop it doing that?
sorry should have said at the start. |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Sep 26, 2002 3:54 pm Post subject: |
|
|
Give this one a spin:
| Code: | dialog create,test,-1,0,100,100
dialog add,edit,E1,1,1,90,50,edit contents,MULTI
dialog add,list,lb,50,1,90,50,
list add,lb,list contents
list add,lb,list contents2
dialog show
wait 3
%a = @dlgtext(E1)
dialog clear,E1
dialog set,E1,@text(lb)
list clear,lb
list add,lb,%a
wait 6 |
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
LinkSisco Valued Newbie
Joined: 17 May 2002 Posts: 30 Location: UK
|
Posted: Thu Sep 26, 2002 5:58 pm Post subject: |
|
|
Thats looks like what I needed.
Let me give it a while and see.... |
|
| Back to top |
|
 |
LinkSisco Valued Newbie
Joined: 17 May 2002 Posts: 30 Location: UK
|
Posted: Thu Sep 26, 2002 6:05 pm Post subject: |
|
|
right, ok...
It copies from the list to the edit fine....
but i need code just for copying all thats in the edit to the list..
Thanks. |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Sep 26, 2002 6:39 pm Post subject: Re: VDS3 - List/Edit copying help |
|
|
Hmmmm, didn't you write?:
| LinkSisco wrote: |
I want to use a button to copy all of the contents of the edit to the list and another button that will copy all thats in the list to the edit.
it must also overwrite everything in the list or edit box when replacing.
|
Well, never mind
Here's one way:
| Code: | dialog create,test,-1,0,100,100,NOSYS
dialog add,edit,E1,1,1,113,50,edit contents@chr(13)@chr(10)This is line 2@chr(13)@chr(10)And #3!,MULTI
dialog add,list,lb,50,1,113,50,
list add,lb,list contents
list add,lb,list contents2
dialog show
wait 3
list create,1
list add,1,@dlgtext(E1)
list clear,lb
list assign,lb,1
wait 3 |
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing
Last edited by Dr. Dread on Fri Sep 27, 2002 4:46 am; edited 1 time in total |
|
| Back to top |
|
 |
LinkSisco Valued Newbie
Joined: 17 May 2002 Posts: 30 Location: UK
|
Posted: Thu Sep 26, 2002 7:40 pm Post subject: |
|
|
Thank you very much, its perfect now...
you forgot to add in "list close,1" but thank you anyway...
perfect... |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Fri Sep 27, 2002 12:54 am Post subject: |
|
|
dialog set,e1,@text(lb)
dialog set,lb,@dlgtext(e1)
NodNarb
P.S. Works every time. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|