As a rule, each line in code should start with a character, so this should not be an issue.
Just in case, you can modify the str2Con method to not convert the data. We have done this as it works (remember to make the added parameter optional). -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Max Belugin Sent: Tuesday, 23 May 2006 7:45 PM To: [email protected] Subject: Re[2]: [development-axapta] editing class method without opening the class str2con try to convert everything to more special types than string. So it is unsafe to parse source codes via str2con -----Original Message----- From: "Arthi.P - Software Engineer - Trainee - SIS" <[EMAIL PROTECTED]> To: <[email protected]> Date: Mon, 22 May 2006 16:01:35 +0530 Subject: RE: [development-axapta] editing class method without opening the class > 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 > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of > Max Belugin > Sent: Sunday, May 21, 2006 1:47 PM > To: [email protected] > Subject: Re: [development-axapta] editing class method without opening the > class > > > 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 > > <[EMAIL PROTECTED]> 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 > > > > > > > > "Arthi.P - Software Engineer - Trainee - SIS" <[EMAIL PROTECTED]> > > > > ___________________________________________________________________________ > > Visit us at www.sundaraminfotech.in > ___________________________________________________________________________ > > This E-mail may contain privileged information and is intended solely for the > addressee, and any disclosure of this information is strictly prohibited, and > may be unlawful. If you have received this mail by mistake, please inform us > immediately and delete this mail. Any information expressed in this mail > does not necessarily reflect the views of SUNDARAM INFOTECH SOLUTIONS. As > per SUNDARAM INFOTECH SOLUTIONS's policy, unencrypted mail via Internet is > not considered secure. > ___________________________________________________________________________ > > > > > > > > Yahoo! Groups Links > > > > > > http://belugin.info Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Home is just a click away.═ Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/development-axapta/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

