SlickEdit Community

SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: murali.sreekantan on May 20, 2007, 09:59:30 am

Title: regarding insert_line and inserting variables value
Post by: murali.sreekantan on May 20, 2007, 09:59:30 am
Hi All,
I have been using slick edit for nearly a year. Now I have a problem.
the problem is like this
I am creating a macro to generate XML. I have line as below which will be inserted (the string is inside a for loop)

insert_line('<LEDGER NAME="Party number" RESERVEDNAME="">');

Instead of the number (the higlighted word) I need a value that will get incremented everytime the string goes through the for loop.
is there any way I can do it?
Regards
Murali
Title: Re: regarding insert_line and inserting variables value
Post by: hs2 on May 20, 2007, 10:46:36 am
This is not too difficult due to the enhanced impl. type conversion of Slick-C:
Example:
Code: [Select]
   int number;  // or typeless
   for ( number = 0; number < 3; number++ )
   {
      insert_line('<LEDGER NAME="Party ' number '" RESERVEDNAME="">');
   }

Good luck,

HS2
Title: Re: regarding insert_line and inserting variables value
Post by: murali.sreekantan on May 20, 2007, 10:57:47 am
Hi,
Thanks for the reply.

Regards
Murali