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 


filter characters
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
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 12:50 pm    Post subject: filter characters Reply with quote

Hello,

I was wondering if there is a way to filter characters out a text.
example: the text is "24/7", and I want to filter "/". How do I do this?

Tsunami1988
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 1:30 pm    Post subject: Reply with quote

Here it is...
__________________________________________________________________________________________________________________________
Code:
%%string = "The text is "24/7", and I want to filter "/"."
%%searchfor = "/"

repeat
%%string = @strdel(%%string,@pos(%%searchfor,%%string),@pos(%%searchfor,%%string))
until @equal(@pos(%%searchfor,%%string),0)

info %%string


I made a lot of string manipulate code that VDS doesn't have. You can take a look at it at my website.
Back to top
View user's profile Send private message
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 2:34 pm    Post subject: Reply with quote

skit3000 wrote:
Here it is...

Code:
%%string = "The text is "24/7", and I want to filter "/"."
%%searchfor = "/"

repeat
%%string = @strdel(%%string,@pos(%%searchfor,%%string),@pos(%%searchfor,%%string))
until @equal(@pos(%%searchfor,%%string),0)

info %%string


I made a lot of string manipulate code that VDS doesn't have. You can take a look at it at my website.

thnx, this works.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 30, 2002 8:02 pm    Post subject: Reply with quote

Here's another way:

Code:

%%string = "24/7"
%%replace = "/"
repeat
  %P = @pos(%%replace,%%string)
  if @greater(%P,0)
    %%string = @strdel(%%string,%P,)
  end
until @zero(%P)

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 8:08 pm    Post subject: Reply with quote

Your way it almost the same, only you have used more lines... If you replace the %P variable with the value of it, you have the same code... Smile

Code:

%%string = "24/7"
%%replace = "/"
repeat
rem Next line has now no use anymore.... If you remove it, it is exactly the same!
if @greater(@pos(%%replace,%%string),0)
  %%string = @strdel(%%string,@pos(%%replace,%%string),)
  end
until @zero(@pos(%%replace,%%string))


Last edited by Skit3000 on Sat Nov 30, 2002 8:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 30, 2002 8:12 pm    Post subject: Reply with quote

Different strokes for different folks!

My way uses one more lne of code, but the way my mind works mine is easier to read, for me that is.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 8:17 pm    Post subject: Reply with quote

You're right there. I sometimes want to make code to complicated...
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sat Nov 30, 2002 8:20 pm    Post subject: Reply with quote

One of the many ideas that I have about programming is to not only make it as useful as possible, but to make it so I can read the script to be able to see what it is doing. One bad habit of mine is that I do not use alot of comments in my source code, because of that, I had to adapt my programming to adjust for that.
_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 8:33 pm    Post subject: Reply with quote

Hey? Who added that long line to my post??? Or am I going mad? Neutral
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: Sat Nov 30, 2002 8:39 pm    Post subject: Reply with quote

LOL, I did. Laughing

On some browsers (mine for instance) code displays
with line breaks within the code tags. You can remedy
this by adding an unbroken underscore long enough
to make your longest line of code stay on one line.

Tommy had fixed that before the board upgrade,
I don't know if he'll do this one or not.

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
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 8:44 pm    Post subject: Reply with quote

I think it is easy to fix that. Just add a long line with the backgroundcolor as textcolor to the post, everytime the CODE tag will be used. That way you don't see it, but it will still be there...
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 8:48 pm    Post subject: Reply with quote

Oops... Doesn't work like it should be, because that long line will also disable the breakoff of normal text, like this long, long line.... Crying or Very sad
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: Sat Nov 30, 2002 8:50 pm    Post subject: Reply with quote

I don't know how he did it, but it only made the post
as wide as needed. An arbitrary line length as you
suggested would prolly be too long or too short most
of the time.

Here's an old announcement for the line fix. We used
it until Tommy modified the board.

http://www.vdsworld.com/forum/viewtopic.php?t=59

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: Sat Nov 30, 2002 8:53 pm    Post subject: Reply with quote

The text outside the code tags didn't break after
his fix either. Ya just hafta use the ENTER key...

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
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Nov 30, 2002 8:55 pm    Post subject: Reply with quote

I know... That's why I typed that long line... Smile
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