Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 16th, 2003, 12:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic Variables

I have some ASP that dynamically created some variables and writes them to a VBScript function. In another function (after the page loads), I want to interact with them. I will pass in a text string that is the name of the variable. Is there a way to access the variable somehow using the string with the variable name in it?

Chris
__________________
Chris
Reply With Quote
  #2 (permalink)  
Old August 20th, 2003, 09:14 AM
flp flp is offline
Registered User
 
Join Date: Aug 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I think you need to make use of the execute() function. Passing a string to the execute() function actually runs the string as VBScript.

This bit of code takes every form item from the previous page, and replaces all apostrophes within for double apostrophes, and assigns it to a variable of the form items HTML name (useful for building a SQL string):

for each Item in Request.Form
  execute("Dim " & Item)
  execute(Item & " = replace(request.form(""" & item & """), ""'"", ""''"")")
next


Reply With Quote
  #3 (permalink)  
Old August 21st, 2003, 11:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks

Chris
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help writing dynamic form data to dynamic table ublend SQL Server ASP 1 June 1st, 2007 08:09 AM
help writing dynamic form data to dynamic table ublend Classic ASP Professional 1 June 1st, 2007 08:08 AM
quicker way to create variables in perl - dynamic? crmpicco Perl 4 March 6th, 2007 07:53 AM
Dynamic variables neo_jakey Classic ASP Professional 3 October 20th, 2005 09:12 AM
Dynamic If...Then using variables Mitch Access 1 March 11th, 2005 10:59 AM



All times are GMT -4. The time now is 06:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.