variable contents problem

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default variable contents problem

    Does sombody knows how can I do to do this :
    <cfset var = "<cfinclude template="file"> <cfoutput> Hi </cfoutput> ">
    In other words to store cfml code and instructions into a cf variable.

    Thx

    S@id+

    mix-tape developer Guest

  2. Similar Questions and Discussions

    1. Execute contents of variable as a command?
      <? $command = "echo 'boo " . rand() . "<br>';"; for ($i = 0; $i <= 50; $i++) { //execute $command } ?>
    2. Is there a way to print out the contents of a variable in human readable format?
      Is it possible to print out the contents of a variable in a human readable format? For instance like PHP's print_r() function? Thanks in...
    3. Is there a way to print out the contents of a variable in hum an readable format?
      Definitely check out Data::Dumper; -----Original Message----- From: Dan Anderson Sent: Wednesday, October 01, 2003 9:55 PM To: Tim Johnson...
    4. Is there a way to print out the contents of a variable in hum an readable format?
      Could you give an example of what you mean? I don't use PHP, but I can think of about three functions that MIGHT be what you're looking for. ...
    5. Passing contents of a flat file to an internal variable
      I want to do something like this inside a sproc: DECLARE @internalText VARCHAR(8000) SET @internalText="c:\myTestXML.XML" QUESTION: ...
  3. #2

    Default variable contents problem

    Does sombody knows how can I do to do this :
    <cfset var = "<cfinclude template="file"> <cfoutput> Hi </cfoutput> ">
    In other words to store cfml code and instructions into a cf variable.

    Thx

    S@id+

    mix-tape developer Guest

  4. #3

    Default Re: variable contents problem

    <cfsavecontent variable="var">
    <cfinclude template="file"> <cfoutput> Hi </cfoutput>
    </cfsavecontent>
    Stressed_Simon Guest

  5. #4

    Default Re: variable contents problem

    Here is how you would do this:

    <CFSAVECONTENT VARIABLE="theVar">
    <CFINCLUDE TEMPLATE="mycfmpage.cfm">
    <CFOUTPUT>Hi</CFOUTPUT>
    </CFSAVECONTENT>

    HTH
    --Dave
    dave_jf Guest

  6. #5

    Default Re: variable contents problem

    thank you Stressed_Simon and dave_jf
    mix-tape developer Guest

  7. #6

    Default Re: variable contents problem

    Use CFSAVECONTENT:

    <cfoutput>
    <cfsavecontent variable="myVar">
    <cfinclude template="some_file.cfm">
    Hello, the time is #TimeFormat(Now(), 'HH:mm:ss')#
    <!--- as much CF code as you like, really --->
    </cfsavecontent>
    #myVar#
    </cfoutput>

    simonr Guest

  8. #7

    Default Re: variable contents problem

    Ok thank you so mutch simonr
    mix-tape developer Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139