变量包含问题 [英] Variable Contains question

查看:64
本文介绍了变量包含问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在应用程序中有一个名为GenericTitle的变量,它包含文本,足够有趣的

人称职位。


我想检查这个变量是否包含director这个词。如果它是
,那么重定向到另一个页面。


有人可以发布一些代码让我检查这个吗?


非常感谢你的帮助。

Hi,

I have a variable in an app called GenericTitle which contains text, a
persons job title funnily enough.

I want to check whether this variable contains the word "director" and if it
does, then redirect to another page for example.

Can somebody post some code that would let me check this?

Your help is much appreciated.

推荐答案

<%


如果CheckIt(stringtocheck)= True然后

Response.Redirect" itsthere.asp"

Else

Response.Write" it''s不存在

结束如果


函数CheckIt(strString)

如果Instr(String," director")那么

CheckIt = True

否则

CheckIt = False

结束功能

结束功能


%>


或者干脆;


<%

如果Instr(StringToCheck," director")那么

Response.Write它就在那里

否则

Response.Write它不在那里

结束如果

%>


-

问候


Steven Burn

Ur I.T. Mate Group
www.it-mate.co.uk


保持免费!


免责声明:

我知道我可能错了,我只是喜欢服用部分; o)

Miguel Orrego< mi **** @ stressmonkey.net-nospam>在消息中写道

news:40 *********************** @ news.dial.pipex.com ...
<%

If CheckIt(stringtocheck) = True Then
Response.Redirect "itsthere.asp"
Else
Response.Write "it''s not there"
End If

Function CheckIt(strString)
If Instr(String, "director") Then
CheckIt = True
Else
CheckIt = False
End Function
End Function

%>

Or simply;

<%
If Instr(StringToCheck, "director") Then
Response.Write "it''s there"
Else
Response.Write "it''s not there"
End If
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I''m probably wrong, I just like taking part ;o)
Miguel Orrego <mi****@stressedmonkey.net-nospam> wrote in message
news:40***********************@news.dial.pipex.com ...


我在一个名为GenericTitle的应用程序中有一个变量,其中包含文本,有趣的人名作业。

我想要检查此变量是否包含单词director如果它是
,那么重定向到另一个页面。

有人可以发布一些代码让我检查这个吗?

非常感谢你的帮助。
Hi,

I have a variable in an app called GenericTitle which contains text, a
persons job title funnily enough.

I want to check whether this variable contains the word "director" and if it does, then redirect to another page for example.

Can somebody post some code that would let me check this?

Your help is much appreciated.



你好史蒂夫,


感谢您的回复,但这似乎只是起作用如果字符串

只包含单词director,例如它包含senior

director它不起作用。


如何修改它,如果它包含导演这个词,不管是什么还有其他什么的b $ b,它会返回是吗?


再次感谢。

" Steven Burn" < nobody@PVT_it-mate.co.uk>在消息中写道

news:e9 ************** @ TK2MSFTNGP10.phx.gbl ...
Hi Steve,

Thanks for your reply, however that only seems to work if the string
contains only the word director, if for example it contains "senior
director" it doesn''t work.

How can I amend that so that if it contains the word director, irrespective
of what else is there, it returns true?

Thanks again.
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
<%

如果CheckIt(stringtocheck)= True那么
Response.Redirect" itsthere.asp"
还是
Response.Write它不在那里
函数CheckIt(strString)
如果Instr(String," director")那么
CheckIt = True
否则
CheckIt =错误结束功能
结束功能

%>

或者干脆;

<%
如果Instr(StringToCheck,director)那么
Response.Write它就在那里
其他
Response.Write它不在那里
结束如果
%>

-
问候

Steven Burn
Ur IT Mate Group
www.it-mate.co.uk <

免费提供!

免责声明:
我知道我可能错了,我只是喜欢参加; o)

Miguel Orrego< mi **** @ stressmonkey.net-nospam>在消息中写道
新闻:40 *********************** @ news.dial.pipex.com ...
<%

If CheckIt(stringtocheck) = True Then
Response.Redirect "itsthere.asp"
Else
Response.Write "it''s not there"
End If

Function CheckIt(strString)
If Instr(String, "director") Then
CheckIt = True
Else
CheckIt = False
End Function
End Function

%>

Or simply;

<%
If Instr(StringToCheck, "director") Then
Response.Write "it''s there"
Else
Response.Write "it''s not there"
End If
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I''m probably wrong, I just like taking part ;o)
Miguel Orrego <mi****@stressedmonkey.net-nospam> wrote in message
news:40***********************@news.dial.pipex.com ...

我在一个名为GenericTitle的应用程序中有一个变量,其中包含文本,有趣的人名作业。

我想检查一下变量包含单词director。并且
Hi,

I have a variable in an app called GenericTitle which contains text, a
persons job title funnily enough.

I want to check whether this variable contains the word "director" and


如果它

那么,然后重定向到另一个页面。

有人可以发布一些代码让我检查这个吗? br />
非常感谢你的帮助。
does, then redirect to another page for example.

Can somebody post some code that would let me check this?

Your help is much appreciated.




它不应该是这样做.....但是,你可以随时修改;


如果Instr(字符串,导演)那么





如果Instr(字符串,导演)那么


-

问候


Steven Burn

Ur IT Mate Group
www.it-mate.co.uk


保持免费!


免责声明:

我知道我可能错了,我只是喜欢服用部分; o)

Miguel Orrego< mi **** @ stressmonkey.net-nospam>在消息中写道

news:40 ********************** @ news.dial.pipex.com。 ..
It shouldn''t be doing that..... but, you can always modify;

If Instr(String, "director") Then

to

If Instr(String, " director") Then

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I''m probably wrong, I just like taking part ;o)
Miguel Orrego <mi****@stressedmonkey.net-nospam> wrote in message
news:40**********************@news.dial.pipex.com. ..
史蒂夫,

感谢您的回复,但是如果字符串
仅包含单词director,那么它似乎只能起作用,例如它包含高级
导演它不起作用。

如何修改它,如果它包含单词director,
而不管还有什么,它会返回true?

Steven Burn < nobody@PVT_it-mate.co.uk>在消息中写道
新闻:e9 ************** @ TK2MSFTNGP10.phx.gbl ...
Hi Steve,

Thanks for your reply, however that only seems to work if the string
contains only the word director, if for example it contains "senior
director" it doesn''t work.

How can I amend that so that if it contains the word director, irrespective of what else is there, it returns true?

Thanks again.
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
<%
Response.Redirect" itsthere.asp"
还是
Response.Write它不在那里
结束如果

函数CheckIt(strString)
如果Instr(String," director")那么
CheckIt = True
否则
CheckIt = False 结束功能
结束功能

%>

或简单地说;

<%
如果Instr(StringToCheck) ,导演然后
Response.Write它就在那里
否则
Response.Write它不在那里
结束如果
%>

-
关于

Steven Burn
你的IT Mate Group
www.it-mate.co.uk <

免费提供!

免责声明:
我知道我可能错了,我只是喜欢参加; o)

Miguel Orrego< mi **** @ stressmonkey.net-nospam>在消息中写道
新闻:40 *********************** @ news.dial.pipex.com ...
<%

If CheckIt(stringtocheck) = True Then
Response.Redirect "itsthere.asp"
Else
Response.Write "it''s not there"
End If

Function CheckIt(strString)
If Instr(String, "director") Then
CheckIt = True
Else
CheckIt = False
End Function
End Function

%>

Or simply;

<%
If Instr(StringToCheck, "director") Then
Response.Write "it''s there"
Else
Response.Write "it''s not there"
End If
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I''m probably wrong, I just like taking part ;o)
Miguel Orrego <mi****@stressedmonkey.net-nospam> wrote in message
news:40***********************@news.dial.pipex.com ...

我在一个名为GenericTitle的应用程序中有一个变量,其中包含文本,有趣的人名作业。

我想检查一下变量包含单词director。和
Hi,

I have a variable in an app called GenericTitle which contains text, a
persons job title funnily enough.

I want to check whether this variable contains the word "director" and


如果

那么,然后重定向到另一个页面。

可以有人发布了一些可以让我查看的代码吗?

非常感谢你的帮助。
does, then redirect to another page for example.

Can somebody post some code that would let me check this?

Your help is much appreciated.





这篇关于变量包含问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆