Clear CGIIN on ARMweb

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Clear CGIIN on ARMweb

Post by YahooArchive »

Is there a way to clear the buffer used by CGIIN in between requests? One
problem is that if the length of one input is shorter than the input before it,
part of the previous input remains and I have no way to tell where the current
input ends.

For example, if the first request is my.htm?123456789, CGIIN returns
"123456789". But if the next request is my.htm?abcde, CGIIN returns
"abcde6789".

So if possible, I'd like to be able to clear the buffer after reading input from
it.


TIA,
MM



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Clear CGIIN on ARMweb

Post by YahooArchive »

The CGIIN should be null terminated.

A simple test shows me the buffer is null terminated each time.
browsing to http://armweb/?123456789 prints 123456789 then browsing to
http://armweb/?abc prints abc

dim CGIinput(100) as string
while 1
CGIinput = CGIIN
if CGIinput(0) then print CGIinput
loop

So we need some more details on how you are doing it and why you don't see what
we see.

--- In ARMexpress@yahoogroups.com, "Mark" wrote:
>
> Is there a way to clear the buffer used by CGIIN in between requests? One
problem is that if the length of one input is shorter than the input before it,
part of the previous input remains and I have no way to tell where the current
input ends.
>
> For example, if the first request is my.htm?123456789, CGIIN returns
"123456789". But if the next request is my.htm?abcde, CGIIN returns
"abcde6789".
>
> So if possible, I'd like to be able to clear the buffer after reading input
from it.
>
>
> TIA,
> MM
>

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: Clear CGIIN on ARMweb

Post by YahooArchive »

Ah I see, using the buffer variable is integral, I was trying to use the return
from CGIIN directly.

I see that it null-terminates that return after any value that was passed has
been read too, cool.


Thanks,
MM

Post Reply