RE: Getting rid of evaluate

2003-03-26 Thread Mark A. Kruger - CFG
Thane,

Make your fields part of a structure...




. etc.

Then, in your loop code,








   


...etc...










Of course depending on what you are trying to do there are probably easier
ways to accomplish it. Your data structure seems unconventional, but I'm
only seeing a tiny piece of it of course. Perhaps the point is to convert a
bunch of individual data members into a 2d array.  An array of structures
might be a better choice if you have more than one collection of these
individual data members.

-Mark





-Original Message-
From: Thane Sherrington [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 8:25 AM
To: CF-Talk
Subject: Getting rid of evaluate


How would I get rid of the evaluates in the following code?

Thanks,

T





 Untitled

























 
 
 
 



 
 
 
 #FieldInfo[FieldNumber][Data]#
 
 
 







~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Getting rid of evaluate

2003-03-26 Thread Dave Watts
> Make your fields part of a structure...

Note that in CFMX, it isn't necessary to do this, since variable scopes are
exposed as structures. I'm pretty sure that they all are; I know for certain
that the Variables scope is.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



RE: Getting rid of evaluate

2003-03-27 Thread Thane Sherrington
At 09:14 AM 03/26/03 -0600, Mark A. Kruger - CFG wrote:
>Thane,
>
>Make your fields part of a structure...

Thanks for the code, I'll try that.


>Of course depending on what you are trying to do there are probably easier
>ways to accomplish it. Your data structure seems unconventional, but I'm
>only seeing a tiny piece of it of course. Perhaps the point is to convert a
>bunch of individual data members into a 2d array.  An array of structures
>might be a better choice if you have more than one collection of these
>individual data members.

I'm trying to create a form system where I can simply enter the field 
information (name, type, size, displayed name, validation) and then some 
generic code will build a form for me.  (I'm tired of building forms and 
data entry scripts from scratch or near scratch every time.)  There's 
probably a better way to do this, but I haven't figured it out. :)

T 

~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4



Re: getting rid of Evaluate in CF 5.0

2004-08-12 Thread Joe Rinehart


...should start to get ya there.

-joe

- Original Message -
From: Jim Louis <[EMAIL PROTECTED]>
Date: Thu, 12 Aug 2004 12:46:48 -0400
Subject: getting rid of Evaluate in CF 5.0
To: CF-Talk <[EMAIL PROTECTED]>

I have a complex page that I use this system right now.  This is  a
sample of the text.

 
 
 
  
 
'0') and (EVALUATE("RM3DAY" &A1) is '0')>

 
 UPDATE table
   SET Day#a1# = 1
 WHERE ID = #query3.New_ID#
 

 

 
 UPDATE table2
SET day#a1# = #new_total#
   WHERE ID = #query.H_ID#
 
 

 More code
 
 

 Is there any what to get rid of all of these evaluate
tags.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: getting rid of Evaluate in CF 5.0

2004-08-12 Thread Jim Louis
Thank you

Jim

>
>
>...should start to get ya there.
>
>-joe
>
>
>- Original Message -
>From: Jim Louis <[EMAIL PROTECTED]>
>Date: Thu, 12 Aug 2004 12:46:48 -0400
>Subject: getting rid of Evaluate in CF 5.0
>To: CF-Talk <[EMAIL PROTECTED]>
>
>I have a complex page that I use this system right now.  This is  a
>sample of the text.
> 
> 
> 
> 
>  
> 
>'0') and (EVALUATE("RM3DAY" &A1) is '0')>
> 
> 
> UPDATE table
>   SET Day#a1# = 1
> WHERE ID = #query3.New_ID#
> 
> 
> 
> 
> 
> UPDATE table2
>SET day#a1# = #new_total#
>   WHERE ID = #query.H_ID#
> 
> 
> 
> More code
> 
> 
> 
> Is there any what to get rid of all of these evaluate
>tags.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: getting rid of Evaluate in CF 5.0

2004-08-12 Thread Pascal Peters
NOT in cf5 it won't (variables became a struct in cf6). But you could
put your vars in a structure and then use that syntax.

Pascal

> -Original Message-
> From: Joe Rinehart [mailto:[EMAIL PROTECTED]
> Sent: 12 August 2004 18:56
> To: CF-Talk
> Subject: Re: getting rid of Evaluate in CF 5.0
> 
> 
> 
> ...should start to get ya there.
> 
> -joe
> 
> 
> - Original Message -
> From: Jim Louis <[EMAIL PROTECTED]>
> Date: Thu, 12 Aug 2004 12:46:48 -0400
> Subject: getting rid of Evaluate in CF 5.0
> To: CF-Talk <[EMAIL PROTECTED]>
> 
> I have a complex page that I use this system right now.  This is  a
> sample of the text.
> 
>  
>  
>  
>  
>  
> '0') and (EVALUATE("RM3DAY" &A1) is '0')>
> 
>  
>  UPDATE table
>    SET Day#a1# = 1
>  WHERE ID = #query3.New_ID#
>  
> 
>  
> 
>  
>  UPDATE table2
> SET day#a1# = #new_total#
>WHERE ID = #query.H_ID#
>  
>  
> 
>  More code
>  
>  
> 
>  Is there any what to get rid of all of these evaluate
> tags.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: getting rid of Evaluate in CF 5.0

2004-08-12 Thread Bryan Love
reconsider the way you create those variables.  How are "RM1DAY" and the
other variables getting created?  A struct or an array would probably work
very nicely to store those variable values differently and speed up your
code.

 
Also, it's generally a very bad idea to put a query inside a loop.  Of all
the times I've seen someone do that, over 90% of them could have been
avoided by structuring the logic differently.


+---+ 
Bryan Love 
  Database Analyst 
  Macromedia Certified Professional 
  Internet Application Developer 
TeleCommunication Systems 
[EMAIL PROTECTED] 
+---+ 

"...'If there must be trouble, let it be in my day, that my child may have
peace'..." 
- Thomas Paine, The American Crisis 

"Let's Roll" 
- Todd Beamer, Flight 93 

-Original Message-
From: Jim Louis [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 12, 2004 9:47 AM
To: CF-Talk
Subject: getting rid of Evaluate in CF 5.0

I have a complex page that I use this system right now.  This is  a sample
of the text.




 

and (EVALUATE("RM3DAY" &A1) is '0')>


UPDATE table
  SET Day#a1# = 1
WHERE ID = #query3.New_ID#





UPDATE table2
   SET day#a1# = #new_total#
  WHERE ID = #query.H_ID#



More code



Is there any what to get rid of all of these evaluate tags. 
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: getting rid of Evaluate in CF 5.0

2004-08-12 Thread Peter Farrell
I'm being anal about something here, but you should be able to remove the pound signs (#) in this statement and it should continue to work correctly:


To:


Sorry, I'm so weird about using pounds - read this article by Ben Forta for a better understand why:
http://www.defusion.com/articles/index.cfm?ArticleID=26

.Peter
MaePub
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: getting rid of Evaluate in CF 5.0

2004-08-13 Thread Jim Louis
Peter,  

  I will get rid of those pesky #'s.  I learned CF from a book. and I did a lot of this scripting in the first few months of programming.

Bryan,

This is what I am trying to do.

1. This is for a registration for a conference. (1500+ registrants) 
2. This part is for a hotel rooms for this conference.  (up to 8 hotels.)
3. There can be up to four people sharing the room each paying their own share of the room. (i.e if the room charge is $100 each 4 people would pay $25.)
4. Roommates are do not always arrive and depart on the same day.
5. I also have a roomblock that must be maintained  accurately. 
    A. I one person is in a room by themselves add one to the room block.
    B. If now person two registers to room with person one then  each is .5 and the room block number is not changed.
    C. If person one and person two both at time of registering did not pick there roommates then the both would have a single room in the room block (i.e. 2 rooms total). 
    D. If person three registers to room with one and two it will make all three and will set them .33 and take one of the rooms out of the room block  (i.e. from two rooms needed down to one with all three in a room.)
    E.  If one of the roommates cancels then it would change the other two to .5 and change nothing with the room block. 
    F. I can go on for a long time with the possible combinations of adding and subtracting roommates.

Current Structure.

Table 1
  Hotel_ID
  HotelName
  HotelDesciption
  TotalRoomBlock
  RBday1
  Totday1
  Date1
  RBday2
  Totday2
  Date2
  Etc.

Table 2
ID
Day1
Day2
Day3
Day4
Day5
Day6
Day7
Day8
Hotel_ID
Hotuser_ID
NID (this relates to the main registration table)
FirstName
LastName
ArrivalDate
DepartureDate
SpecialRequests
Nonsmoking
Bedtype
Roommate1ID (this is NID for the roommate)
Roommate1FirstName
Roommate1LastName
Roommate1ArrivalDate
Roommate1DepartureDate
Roommate1SpecialRequests
Roommate1Nonsmoking
Roommate2ID (this is NID for the roommate)
Roommate2FirstName
Roommate2LastName
etc.

Can you see better structure?  I am using CF 5.0 on an windows 2000 platform with access 2000.  (Yes I know, but the client wants to have the ability to download the whole thing and run access reports on their desktop.)

Jim Louis





>reconsider the way you create those variables.  How are "RM1DAY" and the
>other variables getting created?  A struct or an array would probably work
>very nicely to store those variable values differently and speed up your
>code.
> 
>Also, it's generally a very bad idea to put a query inside a loop.  Of all
>the times I've seen someone do that, over 90% of them could have been
>avoided by structuring the logic differently.
> 
> 
> 
>
>+---+ 
>Bryan Love 
>  Database Analyst 
>  Macromedia Certified Professional 
>  Internet Application Developer 
>TeleCommunication Systems 
>[EMAIL PROTECTED] 
>+---+ 
>
>"...'If there must be trouble, let it be in my day, that my child may have
>peace'..." 
>- Thomas Paine, The American Crisis 
>
>"Let's Roll" 
>- Todd Beamer, Flight 93 
>
>-Original Message-
>From: Jim Louis [mailto:[EMAIL PROTECTED]
>Sent: Thursday, August 12, 2004 9:47 AM
>To: CF-Talk
>Subject: getting rid of Evaluate in CF 5.0
>
>
>I have a complex page that I use this system right now.  This is  a sample
>of the text.
>
>
>
>
> 
>
>and (EVALUATE("RM3DAY" &A1) is '0')>
>
>
>UPDATE table
>  SET Day#a1# = 1
>WHERE ID = #query3.New_ID#
>
>
>
>
>
>UPDATE table2
>   SET day#a1# = #new_total#
>  WHERE ID = #query.H_ID#
>
>
>
>More code
>
>
>
>Is there any what to get rid of all of these evaluate tags. 
>  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]