mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Hello, I have an advertiser dialog with an edit box that you can enter your message in.

edit "", 4, 2 40 216 60, multi autovs vsbar return

If I use $did(4) it only returns the first line so I use $didtok(4,32). The issue is if a line is wrapped to the next line, $didtok(4,32) inserts a space there. So if they have a long link, it will insert a space where the text gets wrapped to the next line. If I use $didtok(4,44) it returns with a space AND a comma. ($chr(44))

Does anyone know how I can retrieve all the text in my multi-line edit box correctly?

here is an example of my edit box and a very long link.



This is what $didtok(4,32) returns. Notice the spaces in the link making the link broken.

Quote:
Testing a long link.... http://www.wasdvdfjnbdfbdfbdhbvdf-dfdfdfbvff.com/cgfds g/sdfgsdfg/dsfgdsfgdfg/df/sdfgdsfgdsfg/dsfgdfsg/dfg/gfd/dfs gdsfgdfsg/dfgdfsgdf/dfgdfgdf/gfdgdfgdfgdf



Thank You!

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You can just use a token separator that cannot be in text, like LF (linefeed character), then remove it from the result:

$remove($didtok(4,10),$lf)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
right, but even when I do not use "32" in didtok, it adds a space, so $didtok(4,44) returns ...


Quote:
Testing a long link.... ,http://www.wasdvdfjnbdfbdfbdhbvdf-dfdfdfbvff.com/cgfds ,g/sdfgsdfg/dsfgdsfgdfg/df/sdfgdsfgdsfg/dsfgdfsg/dfg/gfd/dfs ,gdsfgdfsg/dfgdfsgdf/dfgdfgdf/gfdgdfgdfgdf

Joined: Jan 2008
Posts: 44
J
Ameglian cow
Offline
Ameglian cow
J
Joined: Jan 2008
Posts: 44
No this might sound silly but if its adding a space doesnt a % or something fill it in?


#Plesh on QuaKenet
Jake Randall
Need help?
#Plesh - QuakeNet
Private Message Me Here!
Joined: Dec 2007
Posts: 48
K
Kol Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Dec 2007
Posts: 48
Or use a while loop

Code:
var %x 1
while (%x <= $did($dname,ID).lines) {
var %editbox = %editbox $+ $did($dname,ID,%x)
inc %x
}


%editbox would have the contents of the editbox

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
The biggest problem you'll have is when you WANT a space that happens to be at the end before the line is split. Using $+ will likely remove it if it's at the end of the line before it wraps.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yes Riamus that is my concern.

Also, I don't think writing a whole if statement to handle urls in an edit box should be an option. I would think mIRC already handled this considering it's an edit box.

Looking at this I can't believe that this is an issue with mIRC. I was thinking I was doing something wrong or didn't know how to do it right. It's hard for me to think that this is just an issue with mIRC as the issue is so basic. I mean if you are going to provide an edit box with the ability for multiple lines how could you allow a space between each line.

This is why I figured I may have messed something up in the control parameters or missed something. Is this a bug that should be reported?

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I cannot reproduce that behaviour here; spaces are not automatically appended to each line. I tested with an editbox created with the exact same options as yours.

Are you using the latest version of mirc? Are you sure that the editbox is not already populated by lines ending with a space?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yes I am using the latest mirc. This happens on every computer that uses this dialog not just mine. The text is a link. There are no spaces in the link. The edit box is initially blank. The space shows up where the line gets wrapped to the next line regardless of what the text is.

Please show me the edit box parameters and identifier you use to retrieve the long url without getting spaces where the line wraps.

Thank You.


Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Code:
dialog test {
  size -1 -1 150 100
  edit "", 1, 0 0 150 100, multi autovs vsbar return
}

  • Type /dialog -m test test
  • Type some stuff in editbox (making sure they wrap)
  • Type //echo -ag $remove($didtok(test,1,10),$lf)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard