Results 1 to 3 of 3

Thread: code smarter

  1. #1
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,420
    Provided Answers: 7

    Unanswered: code smarter

    I have this code which will display some on a web page for me
    Code:
    Sub Writeit(This,This1)
    	Response.Write "< strong >" & This & "< / strong > = [" & This1 & "]<br>"
    end sub
    so if I pass call writeit("SQL",SQL)

    I get SQL = [SELECT * FORM MYSTUFF]

    is there a way so I do writeit(SQL)
    i get the same out come
    me just getting write the 2 value into the sub
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    How would it know what columns should be used as "This" and "This1"? I would shoot for something that accepts a recordset, a format string, and an array of column names to use against the format string. Maybe even use token delimiters (like {CurlyBraces}) in your format string and simply walk the record set for column names that match the terms you've wrapped in delimiters. If you're working in .NET, you already have a lot of this for free. Well, actually in .NET you would just use binding against a repeater, but I digress...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I think what the poster is asking is if you can pass a string that is also the name of a variable and have the variable name put out in bold and the value of the variable put out in standard.

    From memory there is no way to do this in classic ASP (not even sure if you can do it in .Net to be honest).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •