1. debug buffer

This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C38298.47E892D0
	charset="iso-8859-1"

I am having trouble checking data in the buffer. I I want to find the =
first position in the buffer and then then displlay the dat in the =
buffer how do i get the first position ? I do a=20
nextless =3D find ('A', buffer)
holdtest =3D buffer[1 ..nextless]=20

jim
Is there any article that describes debugging?

------=_NextPart_000_0007_01C38298.47E892D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2730.1700" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am having trouble checking data in =
the buffer. I=20
I want to find the first position in the buffer and then then displlay =
the dat=20
in the buffer how do i get the first position ? I do a </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>nextless =3D f</FONT><FONT face=3DArial =
size=3D2>ind=20
('A', buffer)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>holdtest =3D buffer[1 =
..nextless]&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>jim</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Is there any article that describes=20

------=_NextPart_000_0007_01C38298.47E892D0--

new topic     » topic index » view message » categorize

2. Re: debug buffer

----- Original Message ----- 
>From: sixs at ida.net 
>Subject: debug buffer
>
>
>
>I am having trouble checking data in the buffer. I I 
>want to find the first position in the buffer and then 
>then displlay the dat in the buffer how do i get the 
>first position ? I do a 
>  nextless = find ('A', buffer)
>  holdtest = buffer[1 ..nextless] 

By 'buffer' I assume you are talking about reading in a text fle and a sequence
is used to hold the text, right?

The code above will locate the first occurance of an 'A' in the buffer. Note
that if its not there, nextless will be set to zero. Try this...

  nextless = find ('A', buffer)
  if nextless = 0 then
      printf(2, "No 'A' in \"%s\"", {buffer})
  else
      printf(2, "Data upto first 'A' is \"%s\"\n",{buffer[1 ..nextless-1]})
printf(2, "Data from first 'A' is \"%s\"\n".{buffer[nextless ..
      length(buffer)]{)
  end if


>jim
>Is there any article that describes debugging?

The best 'debugging' technique is to get somebody else to inspect your code.
That will find most bugs before you even run the app.

However, if you are using the full version of Eu, the the trace feature is very
useful. Otherwise you have to place a lot of 'printf' statement through out your
code to examine variables and flow during the running of your program.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu