| Subject |
Re: custom controls in the INI file |
| From |
Gaetano <gaetanodd@hotmail.com> |
| Date |
Fri, 18 Dec 2020 05:43:14 +1000 |
| Newsgroups |
dbase.getting-started |
I should have provided some background. I was losing my mind while
finalizing the French num2words functions because while I was making
changes to the code, they were not reflected in the output and while
debugging the code to find out where things were going wrong, I saw the
"old" code was being debugged. The "old" code" turned out to be the code
of the CC file loaded in the INI file.
Since I did not add the CC file to the INI file of dBase, I was
wondering how a CC file actually gets in there...
The code loaded in the INI file was superseding the new code because the
class and function names were identical... [the behaviour was very odd:
the change in code would only be effected once I closed the Source
Editor tab of the new Belgian version I was working on - which I cannot
make sense of: why would closing a file in the editor change which FP is
being used for a given function? When the file was open in the Source
Editor, the FP was linked to the French CC file from the INI file and
once the Belgian version was closed in the Editor, the FP was linked to
the updated Belgian CC file I was instantiating in a PRG file - see code
below]
I most certainly didn't get in the menu you refer to hereunder. I
vaguely recall right-clicking on the file and selecting by accident
"load custom components" instead of "Open in Source Editor", but I
didn't think that would put the CC file in the INI file but merely do a
"set proc to" and hence would be overwritten the next time I would
instantiate the CC file and destroyed once I closed dBase.
clear
set proc to :dUFLP:GDLconvertbe.cc
oCon = new GDLconvert() <-- same class name as the French version loaded
in the GDLconvert.cc ini file
?oCon.num2Frenchwords(82) <-- same function name as in the French version
?oCon.num2Frenchwords(1298)
close proc :dUFLP:gdlconvertbe.cc
Cheers,
Gaetano.
On 18/12/2020 04:32, Ken Mayer wrote:
> On 12/17/2020 10:03 AM, Gaetano wrote:
>>
>> Can someone explain how a CC file becomes an entry in the INI file?
>> Just double-click or is there a special procedure to do that?
>
> While building a form or a report, you should be able to add them into
> the .ini file. However, I am not sure why you would want to do that.
> Most of the time it's more trouble than it is worth (the code is always
> loaded everytime you start dBASE). As I have a variety of different
> projects, I don't always want CCs loaded. Instead, I just create a
> "setup" program for an application, if I need things loaded while
> coding, I can just run that, and it will do the necessary "set
> procedure" statements ...
>
> However, if you really must:
>
> In the form designer (or report ...), "File" and notice in the list "Set
> Up Custom Components". The dialog lets you add .cc files that you want
> to load when dBASE starts.
>
> Ken
>
|
|