forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Formatting text in a dialog box
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 3:57 pm    Post subject: Formatting text in a dialog box Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 4:13 pm    Post subject: Reply with quote

Try running your string thru this code (it removes carriage
returns and line feeds). Wink
___________________________________________________________________________________________
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 Smile

_________________
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
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 4:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 4:35 pm    Post subject: Reply with quote

Here's a different approach, add any other chars ya want
allowed to the %%allowed var...

Let us know how this works. Wink
__________________________________________________________________________________________________________________________
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 Smile

_________________
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
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 4:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 5:20 pm    Post subject: Reply with quote

That seems to work as near as I can tell. Confused

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 Smile

_________________
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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 5:27 pm    Post subject: Reply with quote

BTW, if ya don't have this space after "font" on
purpose, ya should remove it. Trailing spaces
are included in most situations... Wink

%%start = @pos(font , %%body)

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 5:42 pm    Post subject: Reply with quote

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... Confused

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 5:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 6:01 pm    Post subject: Reply with quote

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 Smile

_________________
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
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 6:20 pm    Post subject: Reply with quote

Code:
What in the hell is
this goofy little line


When I paste it here, that pipe just makes a new line. Question
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 08, 2002 6:34 pm    Post subject: Reply with quote

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... Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 6:48 pm    Post subject: Reply with quote

It says:

ENTER key sends a
@chr(13)@chr(10)
combination.

BTW, pretty slick little programt there
*applause*
Back to top
View user's profile Send private message
flypaper
Contributor
Contributor


Joined: 19 Oct 2001
Posts: 104

PostPosted: Sun Dec 08, 2002 6:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group