Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 ok guru's... got one for ya... (part 2)
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  06:57:29  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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  Show Profile
Use eval

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  07:04:08  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 12 November 2001 :  07:17:27  Show Profile
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



Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  07:18:53  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 12 November 2001 :  07:34:22  Show Profile
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))

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  07:39:59  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 12 November 2001 :  07:48:37  Show Profile
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

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  07:54:40  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 12 November 2001 :  07:57:08  Show Profile
Why? I think it should

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  08:12:43  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  08:21:52  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  08:29:47  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  08:46:03  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 12 November 2001 :  08:57:53  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
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
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 12 November 2001 :  09:10:59  Show Profile
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

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07