Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

ASP / VB ASSISTANCE PLEASE

Thread Tools
 
Search this Thread
 
Old 28 May 2003, 04:17 PM
  #1  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

If I have a string "Vulnerability1" which currently reads "Absence of Personnel, Improper Disposal of Media - i.e. disposal of media which hasnt been wiped clean, Inadequate Recruitment Procedures" and I want to strip the "Absence of Personnel, " off it and leave variable "Vulnerability2" to read "Improper Disposal of Media - i.e. disposal of media which hasnt been wiped clean, Inadequate Recruitment Procedures" how would you do it?


My best attempt:

vulnerability2 = right(vulnerability1,instr(vulnerability1,"Absence of Personnel, "))

Old 28 May 2003, 04:23 PM
  #2  
ChrisB
Moderator
 
ChrisB's Avatar
 
Join Date: Dec 1998
Location: Staffs
Posts: 23,573
Likes: 0
Received 0 Likes on 0 Posts
Wink

vulnerability2 = "Improper Disposal of Media - i.e. disposal of media which hasnt been wiped clean, Inadequate Recruitment Procedures"

Old 28 May 2003, 04:38 PM
  #3  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

Sorry, the variable changes - God! I thought this was a mature forum
Old 28 May 2003, 04:44 PM
  #4  
markr1963
Scooby Regular
 
markr1963's Avatar
 
Join Date: Jun 2002
Location: Perth, Western Australia
Posts: 1,866
Likes: 0
Received 0 Likes on 0 Posts
Post

LOL @ Chris

How about this...

vunerability2: Right([vunerability1],Len([vunerability1])-InStr([vunerability1],",")-1)

Old 28 May 2003, 04:50 PM
  #5  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

This gives error:

Error Type:
Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/new_cit/risk/exploits/exploits1.asp, line 51, column 87
Old 28 May 2003, 04:53 PM
  #6  
markr1963
Scooby Regular
 
markr1963's Avatar
 
Join Date: Jun 2002
Location: Perth, Western Australia
Posts: 1,866
Likes: 0
Received 0 Likes on 0 Posts
Post

Try it without the square brackets (needed 'em in the Access query from whence it came)

Mark
Old 28 May 2003, 04:55 PM
  #7  
rik1471
Scooby Regular
Thread Starter
 
rik1471's Avatar
 
Join Date: Nov 2001
Posts: 4,788
Likes: 0
Received 0 Likes on 0 Posts
Post

I removed the square brackets, and replaced the : for a = and it errors:

Error Type:
Microsoft VBScript runtime (0x800A0005)
Invalid procedure call or argument: 'Right'
/new_cit/risk/exploits/exploits1.asp, line 51
Old 28 May 2003, 04:57 PM
  #8  
markr1963
Scooby Regular
 
markr1963's Avatar
 
Join Date: Jun 2002
Location: Perth, Western Australia
Posts: 1,866
Likes: 0
Received 0 Likes on 0 Posts
Post

How about right$ instead of right?

Mark
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
30 January 2024 01:27 PM
Phantom_Flan_Flinger
ScoobyNet General
14
23 April 2001 10:23 PM
Rum*
ScoobyNet General
29
29 November 2000 10:05 AM



Quick Reply: ASP / VB ASSISTANCE PLEASE



All times are GMT +1. The time now is 01:10 AM.