Author |
Topic  |
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 06:57:29
|
Refer to Part 1 of this topic for full details regarding what I'm trying to do.
ok, new problem... If you were following the above, then you will spot the problem AS SOON as you hit the submit button and see the results...
Code:
terw = Split(te, Chr(10)) terwsize = Ubound(terw) terwsize = terwsize For I = 0 to terwsize terw(I) = replace(terw(I), chr(10), "") terw(I) = replace(terw(I), chr(13), "") terw(I) = "Response.Write(" & Chr(34) & terw(I) & Chr(34) & " & vbnewline)" 'terw(I) = terw(I) & Chr(10) Next te = Join(terw, Chr(10))
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource
Edited by - da_stimulator on 12 November 2001 07:00:15 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 12 November 2001 : 07:03:30
|
Use eval
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 07:04:08
|
huh?
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 12 November 2001 : 07:17:27
|
I guess I didn't understand you, again .
If your problem is that you don't want the response.write to show up a eval (terw(I)) will output the result of the response.write
I'm not sure that's what you want
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 07:18:53
|
no I want the response.writes to show up, I just dont want them to show up for the script blocks (<% stuff %>)
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 12 November 2001 : 07:34:22
|
what about this? I would change the loop to a while
terw = Split(te, Chr(10)) terwsize = Ubound(terw) terwsize = terwsize For I = 0 to terwsize terw(I) = replace(terw(I), chr(10), "") ' useless terw(I) = replace(terw(I), chr(13), "")
if terw(I) = "<%" then ' skip three loops (I, I+1, I+2) for <%, code and %> and show as you like else
terw(I) = "Response.Write(" & Chr(34) & terw(I) & Chr(34) & " & vbnewline)" end if
Next te = Join(terw, Chr(10))
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 07:39:59
|
if terw(I) = "<%" then ' skip three loops (I, I+1, I+2) for <%, code and %> and show as you like else
That code wouldnt work, because there is an un-predictable amount of loops that I would need to skip, as the data between <% and %> varies depending on input.
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 12 November 2001 : 07:48:37
|
quote: That code wouldnt work, because there is an un-predictable amount of loops that I would need to skip, as the data between <% and %> varies depending on input.
I tought you had all the code in just one array element.
Anyway you could do:
if terw(I) = "<%" then ' skip until terw(I)="%>" else
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 07:54:40
|
Each line is a row in the array, so your second one wont work either :(
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 12 November 2001 : 07:57:08
|
Why? I think it should
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 08:12:43
|
becuase I dont know the row numbers...
Ironically, I found out EXACTLY how to do this with ASP.NET, but no luck with plain ol' asp... (searched MSDN)
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 08:21:52
|
ok, you're right lol - but with the following code I get a syntax error with the skip, and I know its a valid call, I just dont know the syntax...
if Filter(terw, "<" & Chr(37)) = terw(I) then skip until Filter(terw, Chr(37) & ">") = terw(I) end if
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 08:29:47
|
Actually... Skip is mainly used with objects - specifically textstream and filesystem...
Anybody know of any alternatives?
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 08:46:03
|
ok I came up with a possible alternate, but I'm getting error with the Filter Function....
Filterfor1 = "<" & Chr(37) Filterfor2 = Chr(37) & ">" For I = 0 to terwsize if Filter(terw, Filterfor1) = terw(I) then If not(Filter(terw, Filterfor2) = terw(I)) then do until Filter(terw, Filterfor2) = terw(I) I = I + 1 Loop else I = I + 1 end if end if ........
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 November 2001 : 08:57:53
|
Fixed it :)
Filterfor1 = "<" & Chr(37) Filterfor2 = Chr(37) & ">" For I = 0 to terwsize tmpfl1 = Filter(terw, Filterfor1) tmpfl2 = Filter(terw, Filterfor2) if tmpfl1(0) = terw(I) then If not(tmpfl2(0)) = terw(I) then do until tmpfl2(0) = terw(I) I = I + 1 Loop I = I + 1 else I = I + 1 I = I + 1 end if end if
---- -Eric (da_stimulator) Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code Need a Mod? Check out the Mod Resource |
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 12 November 2001 : 09:10:59
|
When I said skip I wasn't talking about the skip directive. Note I had placed a quote at the beginning, sorry for that.
This is how I would do it:
Filterfor1 = "<" & Chr(37) Filterfor2 = Chr(37) & ">" while I < terwsize if terw(I) = Filterfor1 then do until terw(I) = Filterfor2 I = I + 1 Loop else terw(I) = "Response.Write(" & Chr(34) & terw(I) & Chr(34) & " & vbnewline)" i = i+1 end if wend
|
 |
|
Topic  |
|