[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Peter CCH

10/19/2005 6:48:00 AM

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?
7 Answers

José M. Guisado

10/19/2005 7:04:00 AM

0

Take a look at class EditorScripts


Regards,

Jose

"Peter CCH" <PeterCCH@discussions.microsoft.com> escribi&#243; 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?


Peter CCH

10/19/2005 10:20:00 AM

0

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&#195;&#179; 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?
>
>
>

Necmi Göcek

10/22/2005 9:13:00 AM

0

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&#195;&#179; 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?
> >
> >
> >

Peter CCH

10/24/2005 8:40:00 AM

0

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&#195;&#182;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&#195;&#179; 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?
> > >
> > >
> > >

Necmi Göcek

10/24/2005 11:27:00 AM

0

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&#195;&#182;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&#195;&#179; 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?
> > > >
> > > >
> > > >

Joris de Gruyter

10/26/2005 2:55:00 PM

0

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&#246;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&#246;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&#243; 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?
>> > > >
>> > > >
>> > > >


Joris de Gruyter

10/26/2005 3:09:00 PM

0

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&#246;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&#246;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&#243; 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?
>>> > > >
>>> > > >
>>> > > >
>
>