mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
editbox #126315 27/07/05 06:41 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
One line of my dialog:
Code:
 edit "", 11, 18 42 409 288, multi return vsbar



on *:DIALOG:test:sclick:16: {
write txt/file.txt $1
}


How can i save the text which is in editbox in my file.txt ..??


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126316 27/07/05 06:42 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
I find.. sorry for POST!


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126317 28/07/05 07:07 AM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
I have other problem! If i click on ITEM it dont open a dialog... I use this:
on *:DIALOG:pieraksts:sclick:11: {
/dialog -m about_ about_
}


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126318 28/07/05 08:47 AM
Joined: Jul 2005
Posts: 22
B
Boris1234 Offline
Ameglian cow
Offline
Ameglian cow
B
Joined: Jul 2005
Posts: 22
Can you tell me how did yo save a file which is in editbox in to your file.txt ?

i have a problem with that

Re: editbox #126319 28/07/05 11:06 AM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
use /savebuf and /loadbuf to save/load whole contents of edits in dialogs

Re: editbox #126320 28/07/05 12:48 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
If you want to save text from an editbox in a custom dialog, you use:

/write file.txt $did($dname,ID).text

Note tha you if you're in a dialog event, you can reduce this down to:

/write file.txt $did(ID)

ID is the ID of your editbox.


Invision Support
#Invision on irc.irchighway.net
Re: editbox #126321 28/07/05 01:02 PM
Joined: Jul 2005
Posts: 22
B
Boris1234 Offline
Ameglian cow
Offline
Ameglian cow
B
Joined: Jul 2005
Posts: 22
Thank's (:

Re: editbox #126322 28/07/05 05:27 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
I've editbox with multi and vsbar functions! How can i save all lines in file.txt and read all lines in that editbox.. I make Notepad!


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126323 28/07/05 05:45 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327

Use a loop like this:

Code:
set %cnt 1
while (%cnt <= $did(NAME,ID).lines) {
  write file.txt $did(NAME,ID,%cnt)
}
unset %cnt


Info:

$did(NAME,ID).lines = # of lines in your multiline edit box
$did(NAME,ID,N) = Text from line N

NAME = Your dialog name. If called within a dialog event, you can use $dname, or even just leave that off altogether.

ID = ID of the edit box


Invision Support
#Invision on irc.irchighway.net
Re: editbox #126324 28/07/05 06:12 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
it doesnt works.. if i write 2lines it save that text which is in editbox 2times ...
editbox: 1line - hey!! bfffffff..... 2line - How are you?

In file.txt -
Hey!! bff
How are you?
Hey!! bff
How are you?


And how i can read all lines in editbox


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126325 28/07/05 07:15 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Can you paste the code around where you inserted this so I can see how you're calling it? It sounds like you have another loop going on.


Invision Support
#Invision on irc.irchighway.net
Re: editbox #126326 28/07/05 07:31 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
Code:
on *:DIALOG:pieraksts:sclick:16: {
set %cnt 1
while (%cnt <= $did(pieraksts,11).lines) {
  write file.txt $did(pieraksts,11,%cnt)
}
unset %cnt
}

  


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126327 28/07/05 07:37 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
I'm sorry... it's my fault... I always forget to include INC. frown

Here:

Code:
set %cnt 1
while (%cnt <= $did(NAME,ID).lines) {
  write file.txt $did(NAME,ID,%cnt)
  inc %cnt
}
unset %cnt


closed code tags

Last edited by Mentality; 29/07/05 11:33 AM.

Invision Support
#Invision on irc.irchighway.net
Re: editbox #126328 29/07/05 11:16 AM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
Ok, that's work.. But on open a dialog how can i read all text in editbox???


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126329 29/07/05 12:56 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
On open, the only text in an edit box is text you put there. You don't need to read it since you already know what it is. The only way there's text there is if you put it in the dialog's edit "____" part when creating it, or if you use /did -a to stick it in there on init.


Invision Support
#Invision on irc.irchighway.net
Re: editbox #126330 29/07/05 04:07 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
You don't understand.. I open the dialog write in text in the big editbox then press OK button and it save the text in file.txt .. I close the dialog..!! I need that when i open the dialog again the text will be in the editbox!


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126331 29/07/05 06:02 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Ok, I see what you mean.

Code:
on *:dialog:NAME:init:*: {
  did -a $dname ID $read(file.txt)
}


Replace NAME and ID and change the filename.

Note that if you are adding many lines to a multiline edit box, you'll need to put in a loop to read in every line in the file.txt...

Code:
on *:dialog:NAME:init:*: {
  set %cnt $lines(file.txt)
  while (%cnt >= 1) {
    did -i $dname ID 1 $read(file.txt,%cnt)
    dec %cnt
  }
  unset %cnt
}


Invision Support
#Invision on irc.irchighway.net
Re: editbox #126332 29/07/05 06:44 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
I have one more question ..!! How can i read lenght in all lines not only in $did(ID,1 or 2 ...)


[color:red]m[color:blue]IRC[color:green] for EvEr

Re: editbox #126333 29/07/05 07:19 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You'll have to do a loop $did(NAME,ID).lines is total lines, so loop from 1 to that using a WHILE loop and add up all the lengths.


Invision Support
#Invision on irc.irchighway.net
Re: editbox #126334 29/07/05 07:32 PM
Joined: Feb 2005
Posts: 74
S
SkyD Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
ehh... i cant find a right way to make it work.
I have this:
Code:
 
  set %l $did(11).lines
  while (%l <= $did(11)) {
    did -a pieraksts 19 $did(11,%l).len
    inc %l
  }
  unset %l

 


[color:red]m[color:blue]IRC[color:green] for EvEr

Page 1 of 2 1 2