i have created a program(link-generator) which is static in nature(it works correctly) meaning that this program must find the symbol { } first for it to operate properly.how can i make it dynamic so that it can be handled properly regardless of { } symbol ?
anyone please reply!
here is the code: -
-
<%
-
Dim strMessage
-
-
strMessage = "[!*!$!This is*$|198545] a new {!Research & Developement|newresearch } *!assignment* for {!Sanju Shakya}. This is provided"
-
strMessage = strMessage & " on [!20080331|51]. This will {!*!$!be totally developed on Classic ASP*$|Classic ASP} and nothing"
-
strMessage = strMessage & " other tools. This $!*!should be done*$ within [!*!$!today*$|2].{! }"
-
-
-
Function fnSplit(strMessage)
-
Dim buffer
-
Dim strRemain
-
Dim buffer1
-
Dim strNew1
-
Dim strRemain1
-
Dim strRemainder
-
Dim strnewpart
-
-
strRemainder=strMessage
-
-
If instr(strRemainder,"{!") > 0 Then
-
buffer=split(strRemainder,"{!",2)
-
strNew=buffer(0)
-
' for bold
-
If instr(strNew,"*!")> 0 Then
-
strNew = Replace(strNew, "*!","<b>")
-
strNew = Replace(strNew, "*","</b>")
-
End If
-
-
' for italics
-
If instr(strNew,"$!")> 0 Then
-
strNew = Replace(strNew, "$!","<i>")
-
strNew = Replace(strNew, "$","</i>")
-
End If
-
-
If instr(strNew,"[!") > 0 Then
-
buffer35=split(strNew,"[!",2)
-
strNew0=buffer35(0)
-
Response.Write (strNew0)
-
strRemain0=buffer35(1)
-
buffer135=split(strRemain0,"]",2)
-
strNew1=buffer135(0) 'break it and hyperlink it
-
strRemain1=buffer135(1) 'rest
-
strNew0 = strNew0 + fnTxtOperate2 (strNew1, strRemain1)
-
Else
-
Response.Write (strNew)
-
strRemainder = strRemainder + "!%^"
-
buffer35 = split(strRemainder,"!%^",2)
-
strNew0 = buffer35(0)
-
'Response.Write (strNew0)
-
End If
-
-
strRemain=buffer(1)
-
buffer1=split(strRemain,"}",2)
-
strNew1=buffer1(0) 'break it and hyperlink it
-
strRemain1=buffer1(1) 'rest
-
strNew = strNew + fnTxtOperate (strNew1, strRemain1)
-
Else
-
strRemainder = strRemainder + "!%^"
-
buffer2 = split(strRemainder,"!%^",2)
-
strNew = buffer2(0)
-
Response.Write (strNew)
-
End IF
-
-
End Function
-
-
-
Function fnTxtOperate(strNew1, strRemain1) 'text extracion process for {! }
-
Dim buffer3
-
Dim buffer4
-
Dim strNew2
-
Dim strRemain2
-
Dim strTxt
-
'break process
-
If Instr(strNew1,"|") > 0 Then
-
buffer3=split(strNew1,"|",2)
-
strNew2=buffer3(0)
-
strRemain2=buffer3(1)
-
strText="<a href ='" & strRemain2 &"\'>"& strNew2 &"</a>"
-
Else
-
buffer3=split(strNew1,"}",2)
-
strNew2=buffer3(0)
-
strText="<a href ='" & strNew2 & "\'>"& strNew2 &"</a>"
-
End If
-
-
'for bold
-
If instr(strRemain1,"*!")> 0 Then
-
strRemain1 = Replace(strRemain1, "*!","<b>")
-
strRemain1 = Replace(strRemain1, "*","</b>")
-
End If
-
-
' for italics
-
If instr(strRemain1,"$!")> 0 Then
-
strRemain1 = Replace(strRemain1, "$!","<i>")
-
strRemain1 = Replace(strRemain1, "$","</i>")
-
End If
-
-
Response.Write (strText)
-
-
If instr(strRemain1,"!%^") = 0 Then
-
fnSplit (strRemain1)
-
End If
-
End Function
-
-
-
-
Function fnTxtOperate2(strNew135, strRemain1) 'text extracion process if [! ] found
-
-
Dim buffer335
-
Dim buffer435
-
Dim strNew235
-
Dim strRemain235
-
Dim strTxt35
-
'break process
-
If Instr(strNew135,"|") > 0 Then
-
buffer335=split(strNew135,"|",2)
-
strNew235=buffer335(0)
-
strRemain235=buffer335(1)
-
strText35="<a href ='common/default.asp?param=" & strRemain235 & "' >" & strNew235 & "</a> "
-
End If
-
-
Response.Write (strText35)
-
-
If instr(strRemain1,"!%^") = 0 Then
-
fnSplit (strRemain1)
-
End If
-
End Function
-
-
%>
-
<body>
-
<h3>Original Message</h3>
-
<%=strMessage%>
-
<br /><br />
-
<h3>Parsed Message</h3>
-
<%=fnSplit(strMessage)%>
-
<br /><br />
-
<h3>Sample Output Message</h3>
-
This is a new <a href="newresearch\">Research & Developement</a> <b>assignment</b> for <a href="Sanju Shakya\">Sanju Shakya</a>. This is provided
-
on <a href="common\default.asp?param=51">20080331</a>. This will <a href="Classic ASP\">be totally developed on Classic ASP</a> and nothing
-
other tools. This should be done within <a href="common\default.asp?param=2">today</a>.
-
</body>
-
4 1576
i have created a program(link-generator) which is static in nature(it works correctly) meaning that this program must find the symbol { } first for it to operate properly.how can i make it dynamic so that it can be handled properly regardless of { } symbol ?
I'm afraid I don't know how you want it to operate. Do you want it to accept user inputs?
Jared
I'm afraid I don't know how you want it to operate. Do you want it to accept user inputs?
Jared
actually not. the user inputs is not the vital task here. try running once the program .then Your doubt will be cleared.
no concerns regarding the inputs. just try running the program once.
no concerns regarding the inputs. just try running the program once.
jared already asked you provide some details
This is not a right way to posting plz follow the Rule Sign in to post your reply or Sign up for a free account.
Similar topics
by: Massa |
last post by:
Hi all,
I need some help on this one:
I have a webpage with a form. This form submits data that goes to a mdb file
(id (AutoNumber), name, email contry etc.). I would like to make another
page...
|
by: Mike |
last post by:
Hi i have a problem in asp.ne
i am uploading file to the server using htmlinput controls and every thing is o
but i try to upload larger file to the server like more than 4 mb and about 10mb i got...
|
by: Elliot M. Rodriguez |
last post by:
I am having a heckuva time debugging this, or determining why my page is
behaving this way.
I have a search form, that when completed, returns a datagrid. When the user
selects a row (normal...
|
by: News |
last post by:
Hi,
I need help with datalist and linkbutton. I need a LinkButton to display in
datalist if datafield "is_measure_customchecklist" in a db table set to
true.
Here is the code (in parts):
...
|
by: Julia |
last post by:
I need help with architecture design,please:
I have a server which constantly downloading messages from the internet
and store them inside a data base.
the server have two administrators...
|
by: Chris |
last post by:
Hi,
I have a parent page that loads a popup and when the OK button is press it
pass the value back to the parent form textbox. It passes the value but it
doesn't close the popup but also open...
|
by: Polyhedron_12 |
last post by:
I am having problems calling functions in general in VB. I keep
getting alot of errors. Can anybody help me out with this? I put the
error message on the same line that it says it is at. I believe...
|
by: Crash |
last post by:
Hello everyone,
I need help creating an asp page to view a crystal report, which requires that that I change the database connection dynamically. I thought I had this problem licked in CR7 (the...
|
by: Rich Squid |
last post by:
Hello
Here's my basic problem:
On my asp.net form page I have a DetailsView (default mode=edit) bound
to a AccessDataSource control. Users can successfuly update a databound
template field,...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |