source string conatins this code:
type cb_ok from commandbutton within
w_cd_review_regulatory_approval
int X=933
int Y=924
int Width=302
int Height=108
int TabOrder=40
boolean Enabled=false
boolean BringToTop=true
string Text="Approve"
boolean Default=true
int TextSize=-10
int Weight=400
string FaceName="Arial"
FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable!
end type
event
clicked;//*************************************************
*****************
STRING l_Message[]
IF fw_Save() <> c_Success THEN
RETURN
END IF
//---------------------------------------------------------
---------
// Close the window.
//---------------------------------------------------------
---------
Close(PARENT)
//*********************** End of Script ************
end event
type cb_cancel from commandbutton within
w_cd_review_regulatory_approval
int X=1344
int Y=924
int Width=302
int Height=108
int TabOrder=50
boolean BringToTop=true
string Text="Cancel"
boolean Cancel=true
int TextSize=-10
int Weight=400
string FaceName="Arial"
FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable!
end type
event
clicked;//*************************************************
*****************
i_SaveOnClose = c_CloseNoSave
Close(PARENT)
//*********************** End of Script
****************************
end event
I want to get the string from the match :TYPE (followed by
some word) FROM (followed by some word) till i encounter
another such match. But my problem is in the above source
string which i have given it is matching the below whole
thing as a single line in this way that too only at few
places and with type of code ( as different input it is
working fine) what could be the problem?
Close(PARENT) //*********************** End of Script
**************************** end event type cb_cancel
from commandbutton within w_cd_review_regulatory_approval
int X=1344 int Y=924 int Width=302 int Height=108 int
TabOrder=50 boolean BringToTop=true string Text="Cancel"
boolean Cancel=true int TextSize=-10 int Weight=400
string FaceName="Arial" FontFamily FontFamily=Swiss!
FontPitch FontPitch=Variable! end type event
clicked;//*************************************************
*****************
int v_flag=0;
StringReader v_rdr=new StringReader(source);
for(string v_Wline =v_rdr.ReadLine();v_Wline!
=null;v_Wline=v_rdr.ReadLine())
{
while(v_flag==0)
{
if(Regex.IsMatch
(v_Wline,@"type\s+\w+\s+from\s+"+@"\w+",RegexOptio ns.Ignore
Case))
{
Match v_match =Regex.Match
(v_Wline,@"\w+\s+from\s+",RegexOptions.IgnoreCase) ;
v_tempcode=null;
do
{
v_tempcode+=v_Wline+"\n";
v_Wline=v_rdr.ReadLine();
if(v_Wline==null)
{
v_flag=1;
break;
}
}while(!Regex.IsMatch
(v_Wline,@"type\s+\w+\s+from\s+",RegexOptions.Igno reCase));
}
}
-----Original Message-----
Vannela <an*******@discussions.microsoft.com> wrote: I am using stringreader to repeat through each line of
a file ,but my string reader is clubbing 4 to 5 lines as
single line at few places, what could be the problem?
Well, the problem is probably in your code. Please post a
short butcomplete example program which demonstrates the problem -
seehttp://www.pobox.com/~skeet/csharp/complete.html for what
I mean bythat.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.