Hi Hema.,
I've done the same in a form...
Check this code it might be useful....
  static void addingcodeatruntime(Args _args)
{
    TreeNode    treeNode;
    #AOT
    str         oldsource;
    str         newsource;
    str         LineString;
    int         pos;
    container   con;
      int         childCount;
    ;
    TreeNode = TreeNode::findNode(#FormsPath + "\\Form1");    // "Form1" --> Form Name
    treeNode = treeNode.AOTfindChild("Designs");              //Designs Node
    treeNode = treeNode.AOTfindChild("Design");              
    treeNode = treeNode.AOTfindChild("[Tab:Tab2]");
    treeNode = treeNode.AOTfindChild("[TabPage:TabPage]");
    treeNode = treeNode.AOTfindChild("[ButtonGroup:ButtonGroup]");
    treeNode = treeNode.AOTfindChild("CommandButton:CommandButton");
    treeNode = treeNode.AOTfindChild("Methods");
    treeNode = treeNode.AOTfindChild("clicked");
      oldsource = treeNode.AOTgetSource();
   
    con = str2con(oldsource, "\n");
    LineString = conpeek(con,5);
      pos = strscan(oldsource,LineString,1,strlen(oldsource));
    pos += strlen(LineString);
    newSource = strins(oldsource," \n \\Diwakar ",pos);  //new line to be inserted
      treeNode.AOTsetSource(newsource);
    treeNode.AOTcompile(1);
    treeNode.AOTsave();
  }
  regards,
Diwakar Reddy.Atchi

Max Belugin <[EMAIL PROTECTED]> wrote:
  just use string manipulation functions like strScan

16.05.06 × 09:03 × Ó×Ï£Í ÐÉÓØÍÅ ÐÉÓÁÌ(Á):

>
> Hi,
>
> Thank u for ur reply. as u said, i try and get my method source using
> aotgetsource(). can u pls. explain how do i find '\n' s or particular
> line?
> Thank u.
>
> regs,
> Hema. S
>
>
>
>
> Max Belugin
> To:
> [email protected]
> Sent by: cc:
> [EMAIL PROTECTED] Subject: Re:
> [development-axapta] editing class method without
> groups.com opening the class
> 05/15/2006 02:55 PM
> Please respond to
> development-axapta
>
>
>
>
> Use TreeNode.AOTgetSource TreeNode.AOTsetSource
>
> Divide source into lines by finding '\n's
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> To:
> [email protected],[email protected]
> Date: Fri, 12 May 2006 14:01:09 +0530
> Subject: [development-axapta] editing class method without opening the
> class
>
>> Hi all,
>>
>> i got solution for editing method without opening a class. but, i want
>> to
>> add lines in a particular line in the class method. now, it is added in
> the
>> first line of the method. if anyone know the solution, pls. tell me.
> thank
>> u.
>>
>
> http://belugin.info/sidax
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>



--
îÁÐÉÓÁÎÏ × ÐÏÞÔÏ×ÏÍ ËÌÉÅÎÔÅ ÂÒÁÕÚÅÒÁ Opera: http://www.opera.com/mail/






Yahoo! Groups Links









                       
---------------------------------
Do you have a question on a topic you cant find an Answer to. Try Yahoo! Answers India
Send free SMS to your Friends on Mobile from your Yahoo! Messenger  Download now

[Non-text portions of this message have been removed]





SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to