473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

ASP: need help

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:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <%
  3. Dim strMessage
  4.  
  5. strMessage = "[!*!$!This is*$|198545] a new {!Research & Developement|newresearch } *!assignment* for {!Sanju Shakya}. This is provided"
  6. strMessage = strMessage & " on [!20080331|51]. This will {!*!$!be totally developed on Classic ASP*$|Classic ASP} and nothing"
  7. strMessage = strMessage & " other tools. This $!*!should be done*$ within [!*!$!today*$|2].{! }"
  8.  
  9.  
  10. Function fnSplit(strMessage)    
  11.     Dim buffer
  12.     Dim strRemain
  13.     Dim buffer1
  14.     Dim strNew1
  15.     Dim strRemain1
  16.     Dim strRemainder
  17.     Dim strnewpart
  18.  
  19.     strRemainder=strMessage    
  20.  
  21.         If instr(strRemainder,"{!") > 0 Then 
  22.             buffer=split(strRemainder,"{!",2)
  23.             strNew=buffer(0) 
  24.                     ' for bold 
  25.                 If instr(strNew,"*!")> 0 Then
  26.                     strNew = Replace(strNew, "*!","<b>")
  27.                     strNew = Replace(strNew, "*","</b>")
  28.                 End If
  29.  
  30.                 ' for italics
  31.                 If instr(strNew,"$!")> 0 Then
  32.                     strNew = Replace(strNew, "$!","<i>")
  33.                     strNew = Replace(strNew, "$","</i>")
  34.                 End If 
  35.  
  36.                 If instr(strNew,"[!") > 0 Then 
  37.                         buffer35=split(strNew,"[!",2)
  38.                         strNew0=buffer35(0) 
  39.                         Response.Write (strNew0)    
  40.                         strRemain0=buffer35(1)         
  41.                         buffer135=split(strRemain0,"]",2)
  42.                         strNew1=buffer135(0) 'break it and hyperlink it
  43.                         strRemain1=buffer135(1) 'rest         
  44.                         strNew0 = strNew0 + fnTxtOperate2 (strNew1, strRemain1)    
  45.                 Else
  46.                          Response.Write (strNew)
  47.                          strRemainder = strRemainder + "!%^"
  48.                         buffer35 = split(strRemainder,"!%^",2)
  49.                         strNew0 = buffer35(0)
  50.                     'Response.Write (strNew0)
  51.                 End If        
  52.  
  53.             strRemain=buffer(1)         
  54.             buffer1=split(strRemain,"}",2)
  55.             strNew1=buffer1(0) 'break it and hyperlink it
  56.             strRemain1=buffer1(1) 'rest     
  57.             strNew = strNew + fnTxtOperate (strNew1, strRemain1)        
  58.         Else
  59.             strRemainder = strRemainder + "!%^"
  60.             buffer2 = split(strRemainder,"!%^",2)
  61.             strNew = buffer2(0)
  62.             Response.Write (strNew)
  63.         End IF
  64.  
  65. End Function            
  66.  
  67.  
  68. Function fnTxtOperate(strNew1, strRemain1) 'text extracion process for {! }
  69.     Dim buffer3
  70.     Dim buffer4
  71.     Dim strNew2
  72.     Dim strRemain2
  73.     Dim strTxt
  74.                     'break    process
  75.                 If Instr(strNew1,"|") > 0 Then
  76.                     buffer3=split(strNew1,"|",2)
  77.                     strNew2=buffer3(0)
  78.                     strRemain2=buffer3(1)
  79.                     strText="<a href ='" & strRemain2 &"\'>"& strNew2 &"</a>"
  80.                 Else    
  81.                     buffer3=split(strNew1,"}",2)
  82.                     strNew2=buffer3(0)
  83.                     strText="<a href ='" & strNew2 & "\'>"& strNew2 &"</a>"
  84.                 End If             
  85.  
  86.                  'for bold 
  87.                 If instr(strRemain1,"*!")> 0 Then
  88.                     strRemain1 = Replace(strRemain1, "*!","<b>")
  89.                     strRemain1 = Replace(strRemain1, "*","</b>")
  90.                 End If
  91.  
  92.                 ' for italics
  93.                 If instr(strRemain1,"$!")> 0 Then
  94.                     strRemain1 = Replace(strRemain1, "$!","<i>")
  95.                     strRemain1 = Replace(strRemain1, "$","</i>")
  96.                 End If 
  97.  
  98.                 Response.Write (strText)        
  99.  
  100.                 If instr(strRemain1,"!%^") = 0 Then 
  101.                     fnSplit (strRemain1)    
  102.                 End If            
  103. End Function
  104.  
  105.  
  106.  
  107. Function fnTxtOperate2(strNew135, strRemain1) 'text extracion process if [! ] found
  108.  
  109.     Dim buffer335
  110.     Dim buffer435
  111.     Dim strNew235
  112.     Dim strRemain235
  113.     Dim strTxt35
  114.                     'break    process
  115.                 If Instr(strNew135,"|") > 0 Then
  116.                     buffer335=split(strNew135,"|",2)
  117.                     strNew235=buffer335(0)
  118.                     strRemain235=buffer335(1)
  119.                     strText35="<a href ='common/default.asp?param=" & strRemain235 & "' >" & strNew235 & "</a> "
  120.                 End If             
  121.  
  122.                 Response.Write (strText35)        
  123.  
  124.                 If instr(strRemain1,"!%^") = 0 Then
  125.                     fnSplit (strRemain1)    
  126.                 End If            
  127. End Function
  128.  
  129. %>
  130. <body>
  131.     <h3>Original Message</h3>
  132.     <%=strMessage%>    
  133.     <br /><br />
  134.     <h3>Parsed Message</h3>
  135. <%=fnSplit(strMessage)%>
  136. <br /><br />
  137. <h3>Sample Output Message</h3>
  138. This is a new <a href="newresearch\">Research & Developement</a> <b>assignment</b> for <a href="Sanju Shakya\">Sanju Shakya</a>. This is provided
  139. 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
  140. other tools. This should be done within <a href="common\default.asp?param=2">today</a>.
  141. </body>
  142.  
Jul 2 '08 #1
4 1576
jhardman
3,406 Expert 2GB
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
Jul 3 '08 #2
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.
Jul 4 '08 #3
no concerns regarding the inputs. just try running the program once.
Jul 4 '08 #4
idsanjeev
241 100+
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
Jul 4 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

12
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...
3
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...
8
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...
2
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): ...
3
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...
3
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...
2
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...
0
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...
3
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,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
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...
0
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...
0
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...
1
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)...
1
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...
1
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....
0
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
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.