CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Custom Code Location

Print topic Send  topic

Author Message
phil

Posts: 4
Posted: 11/06/2008, 10:27 PM

Apologies in advance if this is a naff question, I am not much of a coder.

I was looking at the many to many listbox example and I am modifiying the custom Subroutine written for it for my own purposes.

The example recommends inserting the custom Sub somewhere between action events. However isn't that a bit sloppy? Doesn't that mean if I regenerate the project from the basic CCS files I will lose that custom code?

I find that using one of the after/before events causes issues as you find yourself nesting your sub in another sub or inside an if...then statement so it won't compile.

So where is the best location for custom code that keeps it inside the CCS framework.

Regards
Phil

View profile  Send private message
melvyn


Posts: 333
Posted: 11/07/2008, 7:01 AM

Hi phil,
No, no, no...
let's do a check in your project, let's say you have a page example.ccp which generates asp or php or java, whatever, let's say php. CCS will generate a file named example.php and example_events.php which contains your custom code. Never edit by yourself the main example.php because that's the generated and *_events.php is the yours.

all custom code must be inserted after you go to properties, events and add a code block, that generates a function and your code must be *inside* that function.

_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com
View profile  Send private message
phil

Posts: 4
Posted: 11/09/2008, 3:26 PM

Hi Melvyn,
Thanks for the response. I understand that your meant to keep your custom code inside the event system. However the Codecharge example in 'many to many listbox' suggests arbitrarily copying the example subroutine directly between event blocks.

I don't wish to do that. However using the event system I end up having troubles as the events themselves are often between if..end if blocks or inside other subroutines.

In a non code-charge web project I would normally just stick it in an include file (asp) or a class file with shared functions/subroutines(asp.net).

So my question is where do people put there common shared functions and contstants in a .net codecharge project??


View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.