- Subject: String type + integer type
- From: Morten Bo Johansen <mojo@xxxxxxxx>
- Date: Sat, 4 Jan 2003 21:28:02 +0100
Hi,
I am trying to create a function that delimits plural msgstr's
in po-files. They may look like this
#: frm/frm.c:406
#, c-format
msgid "You have %d message.\n"
msgid_plural "You have %d messages.\n"
msgstr[0] "first string"
msgstr[1] "second string"
...
msgstr[n] ""
I wanted to do it something like this:
define mark_msgstr_plurals ()
{
operate_on_strings (); % narrow to a block of strings
if (re_fsearch ("^msgstr[ ]*\\["))
{
message ("Enter number og msgstr to edit:");
update_sans_update_hook (0);
variable n = getkey ();
if (n == 0)
{
[ mark first msgstr..]
}
else
{
re_fsearch ("^msgstr[ ]*\\[" + value of 'n')
fsearch ("\"");
push_mark ();
...
}
that is, I would like to have the value of 'n', entered by the
user, to be appended to the search string. I was well aware that
the expression above would be invalid, it was just for
illustration purposes.
I have been looking at various possible solutions with
custom_variable and Sprintf but I can't seem to get it to behave.
At present I am using a case statement for each number but if
the other solution was doable it would be more elegant.
Regards,
Morten
--
"Anyone can do any amount of work provided it isn't the work he is supposed
to be doing at that moment." (Robert Benchley)
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2003 date index]
[2003 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]