mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#126315 - 27/07/05 07:41 PM editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126316 - 27/07/05 07:42 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
I find.. sorry for POST!
_________________________
[color:red]m[color:blue]IRC[color:green] for EvEr


Top
#126317 - 28/07/05 08:07 AM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126318 - 28/07/05 09:47 AM Re: editbox
Boris1234 Offline
Ameglian cow

Registered: 21/07/05
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

Top
#126319 - 28/07/05 12:06 PM Re: editbox
ClickHeRe Offline
Fjord artisan

Registered: 29/01/03
Posts: 249
Loc: Ottawa, Canada
use /savebuf and /loadbuf to save/load whole contents of edits in dialogs
_________________________
David

DCX - Dialog Control eXtension

Top
#126320 - 28/07/05 01:48 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#126321 - 28/07/05 02:02 PM Re: editbox
Boris1234 Offline
Ameglian cow

Registered: 21/07/05
Posts: 22
Thank's (:

Top
#126322 - 28/07/05 06:27 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126323 - 28/07/05 06:45 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA

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

Top
#126324 - 28/07/05 07:12 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126325 - 28/07/05 08:15 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#126326 - 28/07/05 08:31 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126327 - 28/07/05 08:37 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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


Edited by Mentality (29/07/05 12:33 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#126328 - 29/07/05 12:16 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126329 - 29/07/05 01:56 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#126330 - 29/07/05 05:07 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126331 - 29/07/05 07:02 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#126332 - 29/07/05 07:44 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
#126333 - 29/07/05 08:19 PM Re: editbox
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#126334 - 29/07/05 08:32 PM Re: editbox
SkyD Offline
Babel fish

Registered: 04/02/05
Posts: 74
Loc: Latvia
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


Top
Page 1 of 2 1 2 >