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 | 05:17 PM
  #1  
rik1471's Avatar
rik1471
Thread Starter
Scooby Regular
 
Joined: Nov 2001
Posts: 4,788
Likes: 0
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 | 05:23 PM
  #2  
ChrisB's Avatar
ChrisB
Moderator
 
Joined: Dec 1998
Posts: 23,573
Likes: 0
From: Staffs
Wink

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

Old 28 May 2003 | 05:38 PM
  #3  
rik1471's Avatar
rik1471
Thread Starter
Scooby Regular
 
Joined: Nov 2001
Posts: 4,788
Likes: 0
Post

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

LOL @ Chris

How about this...

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

Old 28 May 2003 | 05:50 PM
  #5  
rik1471's Avatar
rik1471
Thread Starter
Scooby Regular
 
Joined: Nov 2001
Posts: 4,788
Likes: 0
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 | 05:53 PM
  #6  
markr1963's Avatar
markr1963
Scooby Regular
 
Joined: Jun 2002
Posts: 1,866
Likes: 0
From: Perth, Western Australia
Post

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

Mark
Old 28 May 2003 | 05:55 PM
  #7  
rik1471's Avatar
rik1471
Thread Starter
Scooby Regular
 
Joined: Nov 2001
Posts: 4,788
Likes: 0
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 | 05:57 PM
  #8  
markr1963's Avatar
markr1963
Scooby Regular
 
Joined: Jun 2002
Posts: 1,866
Likes: 0
From: Perth, Western Australia
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 02:27 PM
Phantom_Flan_Flinger
ScoobyNet General
14
23 April 2001 11:23 PM
Rum*
ScoobyNet General
29
29 November 2000 11:05 AM




All times are GMT +1. The time now is 03:22 PM.