<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>20 Jan 2015 16:11:00 Z</lastBuildDate><pubDate>19 Jan 2015 08:19:00 Z</pubDate><description>Hi&#13;
For a generic data import routine I am writing I need to be able to declare a class which corresponds to the data file I am using. I have done something like this previously as follows MyClass is object dynamic SWITCH ls_filename CASE "CusMast": MyClass is NEW CusMastClass CASE "STKMast": MyClass is NEW STKMastClass etc etc I have quite a lot of data files which could potentially import data so what I would like to do is declare something like MyClass is NEW ClassName where ClassName is a string field from a data table, which holds "CusMastClass", "STKMastClass" etc.&#13;
&#13;
Declared as above doesn't work &amp; neither does indirection. Is anything like this possible or do I have to stick to a huge SWITCH statement?&#13;
&#13;
Thanks&#13;
&#13;
David</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp</link><title>[WD] Dynamic Class Declaration</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49970/read.awp</comments><pubDate>20 Jan 2015 16:11:00 Z</pubDate><description>Alexandre&#13;
&#13;
Thanks for the update.&#13;
You are correct - something new every day&#13;
This is one of the best NG's I have ever partici…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49970/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49970/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49965/read.awp</comments><pubDate>20 Jan 2015 15:32:00 Z</pubDate><description>Hi DerekT,&#13;
&#13;
The only clarification is that I did not know it was possible to do it that way. We learn new stuff everyday. (In …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49965/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49965/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49940/read.awp</comments><pubDate>19 Jan 2015 21:41:00 Z</pubDate><description>Thanks everyone for the response.&#13;
&#13;
I've gone with Bart's/DerekT's suggestion. Works like a charm.&#13;
&#13;
Cheers&#13;
&#13;
David</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49940/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49940/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49934/read.awp</comments><pubDate>19 Jan 2015 16:22:00 Z</pubDate><description>Alexandre&#13;
&#13;
Just looking for clarification - experience tells me that there may always be a better way of doing things.&#13;
&#13;
How …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49934/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49934/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49927/read.awp</comments><pubDate>19 Jan 2015 14:27:00 Z</pubDate><description>Hi David and Arie,&#13;
&#13;
We use Compile() since years to do just that. In fact, now with the new ExecuteCode() syntax, this is easi…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49927/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49927/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49924/read.awp</comments><pubDate>19 Jan 2015 12:58:00 Z</pubDate><description>David&#13;
&#13;
I use the following.... simplified but should give you an idea&#13;
&#13;
PROCEDURE lpImport(pTrgtClass is string) //Name of th…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49924/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49924/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49920/read.awp</comments><pubDate>19 Jan 2015 11:28:00 Z</pubDate><description>I think something like this should work :&#13;
&#13;
ClassName is string = "ClassPart"&#13;
&#13;
myclass is object dynamic&#13;
&#13;
myclass = new Cla…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49920/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49920/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49919/read.awp</comments><pubDate>19 Jan 2015 10:53:00 Z</pubDate><description>David,&#13;
&#13;
maybe the use of Compile() would work.&#13;
Build the code to compile as a string (using your data table, which holds "Cus…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49919/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49919/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49918/read.awp</comments><pubDate>19 Jan 2015 10:33:00 Z</pubDate><description>Hi ,&#13;
&#13;
First I think you should not use the" : "&#13;
&#13;
You could try something like this:&#13;
&#13;
import is Class&#13;
END&#13;
&#13;
CusMast is Cl…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49918/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration-49918/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/49915-dynamic-class-declaration/read.awp">[WD] Dynamic Class Declaration</source><title>Re: [WD] Dynamic Class Declaration</title></item></channel></rss>
