Professional Web Applications Themes

CFC getter and whitespace - Coldfusion - Advanced Techniques

Wondering if this is a bug. Using the following code. <cfapplication name="test" sessionmanagement="yes"> <cflock timeout="20" type="exclusive" scope="session"> <cfscript> SESSION.cfcEmployee = createObject("component", "Employee"); SESSION.cfcEmployee.setFName("Joe"); getterVar = SESSION.cfcEmployee.getFName(); </cfscript> </cflock> <cfoutput> SESSION.cfcEmployee.fname = #SESSION.cfcEmployee.fName# getFName() = #Trim(SESSION.cfcEmployee.getFName())# getterVar = #getterVar# </cfoutput> This is the output in the html source code... SESSION.cfcEmployee.fname = Joe getFName() = Joe getterVar = Joe When I try to output the value directory w/my cfc 'getFName()' method, I cannot get rid of the whitespace. I've tried using trim() to no avail. Any thoughts?...

  1. #1

    Default CFC getter and whitespace

    Wondering if this is a bug. Using the following code.

    <cfapplication name="test" sessionmanagement="yes">
    <cflock timeout="20" type="exclusive" scope="session">
    <cfscript>
    SESSION.cfcEmployee = createObject("component", "Employee");
    SESSION.cfcEmployee.setFName("Joe");
    getterVar = SESSION.cfcEmployee.getFName();
    </cfscript>
    </cflock>
    <cfoutput>
    SESSION.cfcEmployee.fname = #SESSION.cfcEmployee.fName#
    getFName() = #Trim(SESSION.cfcEmployee.getFName())#
    getterVar = #getterVar#
    </cfoutput>

    This is the output in the html source code...

    SESSION.cfcEmployee.fname = Joe
    getFName() =
    Joe
    getterVar = Joe


    When I try to output the value directory w/my cfc 'getFName()' method, I
    cannot get rid of the whitespace. I've tried using trim() to no avail. Any
    thoughts?

    BSterner Guest

  2. #2

    Default Re: CFC getter and whitespace


    [url]http://awads.net/wp/2005/06/15/coldfusion-and-white-space/[/url]

    Eddie Guest

  3. #3

    Default Re: CFC getter and whitespace

    You may have a carriage return in your string or other wierd characters,
    which would not go away using the trim function. Maybe you can use a regular
    expression to replace any non-alpha character with an empty string.


    "BSterner" <webforumsusermacromedia.com> wrote in message
    news:dajodk$mgi$1forums.macromedia.com...
    > Wondering if this is a bug. Using the following code.
    >
    > <cfapplication name="test" sessionmanagement="yes">
    > <cflock timeout="20" type="exclusive" scope="session">
    > <cfscript>
    > SESSION.cfcEmployee = createObject("component", "Employee");
    > SESSION.cfcEmployee.setFName("Joe");
    > getterVar = SESSION.cfcEmployee.getFName();
    > </cfscript>
    > </cflock>
    > <cfoutput>
    > SESSION.cfcEmployee.fname = #SESSION.cfcEmployee.fName#
    > getFName() = #Trim(SESSION.cfcEmployee.getFName())#
    > getterVar = #getterVar#
    > </cfoutput>
    >
    > This is the output in the html source code...
    >
    > SESSION.cfcEmployee.fname = Joe
    > getFName() =
    > Joe
    > getterVar = Joe
    >
    >
    > When I try to output the value directory w/my cfc 'getFName()' method, I
    > cannot get rid of the whitespace. I've tried using trim() to no avail.
    Any
    > thoughts?
    >

    Guest

Similar Threads

  1. Yahoo! Getter
    By Jason Dusek in forum PERL Beginners
    Replies: 8
    Last Post: November 26th, 08:54 PM
  2. Reply to the list WAS Yahoo! Getter
    By Bob Showalter in forum PERL Beginners
    Replies: 0
    Last Post: November 26th, 08:45 PM
  3. [PHP-DEV] Property setter and getter in PHP5
    By Derick Rethans in forum PHP Development
    Replies: 6
    Last Post: July 21st, 06:14 PM
  4. [PHP-DEV] Property setter and getter in PHP5
    By Masoud in forum PHP Development
    Replies: 0
    Last Post: July 20th, 05:14 PM
  5. [PHP-DEV] Property setter and getter in PHP5
    By John Lim in forum PHP Development
    Replies: 0
    Last Post: July 20th, 04:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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