Joris de Gruyter
10/26/2005 3:09:00 PM
forgot to mention, i am talking about taking the declaration string, and
compiling and running it from your script code.
"Joris de Gruyter" <joris> wrote in message
news:O9G$C1j2FHA.3188@TK2MSFTNGP12.phx.gbl...
> Interesting question. There''s no ''standard'' or ''built-in'' way to get this.
> There is one thing you can try but wont work in all cases... That is
> taking the declaration of your method (method declaration and local
> variables), and changing it to return your <selectedtable>.tableid. This
> will error return your tableid or give a compile error. In the case of the
> compile error you dont know, in case of a number being returned you know
> the tableid.
> This of course will only work for local variables, but maybe i gave you an
> idea on how you can try to crack this. In case of a class you could try to
> get the declarations out of the classdeclaration too ;-)
>
> Anyway, i''m afraid this is not going to work, but what i described above
> may give you _some_ result, but not much.
>
>
> J.
>
>
>
>
> "Necmi Göcek" <NecmiGcek@discussions.microsoft.com> wrote in message
> news:657753BD-03D8-453D-A6C7-DE0C086C4639@microsoft.com...
>> It seems impossible to me. There are two problems;
>> 1) How to get TableName by using instance of that table(as you stated)
>> 2) How to pass previously founded Tablename to
>> EditorScripts\addins_tableBrowser() method.
>>
>> I think second one can be done by using a table for that but i can''t find
>> a
>> way to solve first one. If anyone got a solution I''m glad to hear that.
>> --
>> _MIB_
>>
>>
>> "Peter CCH" wrote:
>>
>>> It works, thanks.
>>> But I must select the table name or the table variable that has the same
>>> namd as the table in order to make it works.
>>>
>>> If I have a variable declared with different name, it won''t works.
>>> Eg.
>>> CustTable _custTableCheck;
>>>
>>> When I highlight the word "_custTableCheck", and click on the table
>>> broswer
>>> (the code I add in), it won''t works cause it can get the table name.
>>>
>>> Is there any method I can used to get the table name from the variable
>>> declared?
>>>
>>> Eg.
>>> PurchTable _purchTableCheck;
>>> By highlight the variable "_purchTableCheck", I can get the table name
>>> "PurchTable".
>>>
>>>
>>>
>>> "Necmi Göcek" wrote:
>>>
>>> > Hi Peter,
>>> >
>>> > Open Classes\EditorScripts.
>>> > Add new method.
>>> >
>>> > void addIns_TableBrowser(Editor e)
>>> > {
>>> > SysTableBrowser sysTableBrowser;
>>> > str tableName;
>>> > int tableId;
>>> > ;
>>> > tableName = strrtrim(EditorScripts::getSelectedText(e));
>>> > tableName = substr(tableName, 1, strlen(tableName)-2);
>>> > tableId = TableName2Id(tableName);
>>> > if(tableId)
>>> > {
>>> > sysTableBrowser = new sysTableBrowser();
>>> > sysTableBrowser.run(TableName2Id(tableName));
>>> > }
>>> > }
>>> >
>>> > Note: I assume that you place your menu under addins menu if you want
>>> > to
>>> > change the location of the menu just prefix it with appropriate one
>>> > ("addinds_","web_","comments_"....)
>>> > --
>>> > _MIB_
>>> >
>>> >
>>> > "Peter CCH" wrote:
>>> >
>>> > > How about the menu poped up when we right click on the editor?
>>> > > Actually I wish to write something like this:
>>> > >
>>> > > When I right click on a variable declared as table, then I have one
>>> > > more
>>> > > function extra in the menu - Table Browser. This will made it a lot
>>> > > easier to
>>> > > see the table data. I don''t need to go to AOT and search for that
>>> > > table and
>>> > > open table browser from there.
>>> > >
>>> > > Any idea how to code it?
>>> > >
>>> > >
>>> > > "jmg" wrote:
>>> > >
>>> > > > Take a look at class EditorScripts
>>> > > >
>>> > > >
>>> > > > Regards,
>>> > > >
>>> > > > Jose
>>> > > >
>>> > > > "Peter CCH" <PeterCCH@discussions.microsoft.com> escribió en el
>>> > > > mensaje
>>> > > > news:56732119-1D52-4D29-AC06-BA09666BDDD9@microsoft.com...
>>> > > > > When we right click on the code section, there''s a menu
>>> > > > > "Scripts", there''s
>>> > > > > some script over that we can use such as adding comment.
>>> > > > >
>>> > > > > Where can I customize and put in my own script over there?
>>> > > >
>>> > > >
>>> > > >
>
>