| View previous topic :: View next topic |
| Author |
Message |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 3:57 pm Post subject: Formatting text in a dialog box |
|
|
I had an HTML stripping question a couple of weeks ago. I finally got around to fixing the problem. Now I have a new one! After I have stripped away all the HTML out of a message and put the text into a dialog box it always show up on 2 lines. It's almost like there is a @CR() there, but there obviously isn't. This message is then sent out to a pager, where it shows up normally. So it's really just a silly little formatting question when it's put into the dialog box. What am I doing wrong, or how can I fix this?
I don't think it's needed but here is how it shows up in a dialog box:
The quick fox
jumped |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 4:13 pm Post subject: |
|
|
Try running your string thru this code (it removes carriage
returns and line feeds).
___________________________________________________________________________________________
| Code: |
%s = your string goes here
%x = 1
REPEAT
if @equal(@substr(%s, %x), @chr(13))@equal(@substr(%s, %x), @chr(10))
%s = @strdel(%s, %x,)
%x = @pred(%x)
end
%x = @succ(%x)
UNTIL @greater(%x, @len(%s))
|
[EDIT] Added line to allow for %x being off when we deleted
a char.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361

Last edited by Mac on Sun Dec 08, 2002 7:09 pm; edited 1 time in total |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 4:21 pm Post subject: |
|
|
Now it show up on one line with a | (pipe) where it was on the second line. Apparently, that pipe looking character must be a break since when I try to paste the text here the pipe goes away and the second line comes back.
line break test goes
here
I'm so confused. I don't understand why it's getting put there.
Would it help if I posted the offending code? |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 4:35 pm Post subject: |
|
|
Here's a different approach, add any other chars ya want
allowed to the %%allowed var...
Let us know how this works.
__________________________________________________________________________________________________________________________
| Code: |
%s = your string goes here
%%allowed = "abcdefghijklmnopqrstuvwxyz _-+=[]{};':",./<>?\|`~!@#$%^&*()0123456789"@chr(34)
%x = 1
REPEAT
if @equal(@pos(@substr(%s, %x), %%allowed), 0)
%s = @strdel(%s, %x)
%x = @pred(%x)
end
%x = @succ(%x)
UNTIL @greater(%x, @len(%s))
|
[EDIT 1] - Changed %%allowed to include all keyboard chars (I think)...
[EDIT 2] - Added a line to adjust %x when we delete a char.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361

Last edited by Mac on Sun Dec 08, 2002 7:12 pm; edited 1 time in total |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 4:58 pm Post subject: |
|
|
Same thing. Lemme show ya what I'm doing here. Maybe I have coded something wrong.
| Code: |
%%body = @INTERNET(POP3, BODY, 1)
%%start = @pos(font , %%body)
%%end = @pos(</font>, %%body)
%%newbody = @substr(%%body, %%start, %%end)
%%fstart = @succ(@pos(>, %%newbody))
%%fend = @pred(@len(%%newbody))
%%final = @substr(%%newbody, %%fstart, %%fend)
dialog set, body, %%final
|
Where %%body equals:
| Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=904104616-08122002><FONT face=Arial size=2>Here is the only
part I want to keep!</FONT></SPAN></DIV></BODY></HTML>
|
Is there a better way for me to do this? |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 5:20 pm Post subject: |
|
|
That seems to work as near as I can tell.
Try putting this after your routine, and see if any extra spaces
etc. show up between the arrows.
INFO ->%%final<-
Also, what type of element is "body" (dialog set, body, %%final)?
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 5:27 pm Post subject: |
|
|
BTW, if ya don't have this space after "font" on
purpose, ya should remove it. Trailing spaces
are included in most situations...
%%start = @pos(font , %%body)
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 5:31 pm Post subject: |
|
|
It shows up like this:
And 'BODY' is an edit box.
EDIT - And the space was put there intentionally after the word 'font ' but, as I review it, isn't required. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 5:42 pm Post subject: |
|
|
Did ya run %%final thru the routines I posted before
using dialog set, body, %%final?
Actually, either of them should work - especially the last
one that only allows keyboard chars...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 5:52 pm Post subject: |
|
|
I did this time and this is what I get:
And please excuse the crappy edit but here is what it looks like:
Thanks for your help so far. |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 6:01 pm Post subject: |
|
|
OK - Copy that line from the edit box and post it here
between CODE tags. I'd like to know what it is...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 6:20 pm Post subject: |
|
|
| Code: | What in the hell is
this goofy little line |
When I paste it here, that pipe just makes a new line.  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Dec 08, 2002 6:34 pm Post subject: |
|
|
Well, it only shows up as <BR> here...
I'm running out of ideas, but you can prolly use the
scan code program in the VDS3 source code to find
what it is.
Copy ONLY the little bar looking thingy, paste it in
the edit box in the scan code program and press find.
The scan code checker is here:
http://www.vdsworld.com/forum/viewtopic.php?t=407
Let me know what happens. Hopefully we can remove it
once we know what it is...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 6:48 pm Post subject: |
|
|
It says:
ENTER key sends a
@chr(13)@chr(10)
combination.
BTW, pretty slick little programt there
*applause* |
|
| Back to top |
|
 |
flypaper Contributor


Joined: 19 Oct 2001 Posts: 104
|
Posted: Sun Dec 08, 2002 6:52 pm Post subject: |
|
|
| I really wish I knew what was wrong with vdsipp.dll and Outlook HTML mail. Before my company started using Outlook, HTML mail was never a problem for the program. Grrrrr |
|
| Back to top |
|
 |
|