On Wed, 25 Jul 2007, Tiziano_mk wrote:
> Michael Van Canneyt wrote:
> >
> > On Wed, 25 Jul 2007, Tiziano_mk wrote:
> > > After some other tests, actually I realize that the biggest problem is due
> > > to
> > > the $(varname) substitution schema (can't save a project as
> > > $(projname).lpr).
> >
> > This was a known shortcoming when I implemented it. I renamed the files
> > in the explorer/commandline :-)
>
> So it's you the responsible of this nice thing... :-)
>
> > > My idea is to solve this second bunch of troubles changing this schema
> > > from
> > > $(varname) to __varname__.
> >
> > This is OK, with one proviso:
> >
> > I would only do this for filenames, because __something__ is a valid
> > pascal identifier, which should not be changed when performing
> > substitutions. For source code, I would stick to $()
>
> Sorry, but it's not possible.
>
> When you save a project as $(projname) the IDE checks the filename in order to
> change the line "program project1;" to "program $(projname);" and since this
> is not a valid project name (neither a valid pascal identifier) this is not
> allowed. Quite the same thing for units, libraries and packages.
Aha. The IDE is once again trying to be too clever :)
I didn't take this into account, but you are right.
>
> If this requirement is so mandatory, then I think that the only solution is to
> write a "SaveProjectasTemplate" procedure and a "Save Project as Template..."
> menu command.
I don't think this is so easy, because you don't know what must be replaced
and what not, only the user can decide that.
In that case I think your original proposal with the underscores is better.
Since the variable names must be defined in the template info file anyway, the
risc is minimal. So please implement your original __varname__ proposal.
Michael.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives