[fpc-pascal] Fwd: [PSP-DEVEL] help me solve read/ln feature of webtext

Bisma Jayadi bisma at brawijaya.ac.id
Tue Jan 16 04:57:09 CET 2007


-------- Original Message --------
Subject: [PSP-DEVEL] help me solve read/ln feature of webtext
Date: Mon, 15 Jan 2007 18:30:12 +0700
From: Bisma Jayadi <bisma at brawijaya.ac.id>
Reply-To: pascal-webdev-devel at lists.sourceforge.net
Organization: UPPTI Unibraw
To: Milis PSP <pascal-webdev-devel at lists.sourceforge.net>

Hi all,

I'm getting close to complete write/ln and read/ln text driver for web utilizing
PWU. Basic functions have been done. Splitting process (asking for input and
getting the value) has solved easily because they are already seperated on the
driver. But there is still one problem left. I've been trying to solve this
almost all the day long, but I got no clues.

The complete webtext.pas unit is attached. This version has been reduced, I've
removed any unnecessary procedures/functions. Please bring your attention to 2
functions that I have problem with, they are WebTextRead() at line 106 and
WebReturn() at line 127. You can skip the write/ln functions as I believe they
have work well.

The problem with read/ln procedures is that I keep losing the first input
variabel content. What I meant 'losing' is the values got shifted to the next
variable. Here's for example:

program test;
{$mode objfpc}{$H+}
uses
    WebText;
var
    s, t, u: string;
begin
    Write('Enter your last name: ');
    Read(s); Writeln;
    Write('Enter your first name: ');
    Read(t); Writeln;
    Write('Enter your pet name: ');
    Read(u); Writeln;
    Write('Your full name is: ', s+', '+t+', '+u);
    Writeln;
end.

If I enter values 'var1' to s, 'var2' to t, and 'var3' to u, the result become:
s contains nothing (empty/null?), t contains 'var1', and u contains 'var2'. I
don't understand why it becomes like that. I think all code and logic is already
in order.

Any help is very much appreciated. Thanks in advance.

-Bee-

has Bee.ography at:
http://beeography.wordpress.com

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: WebText.pp
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20070116/02226b01/attachment.ksh>


More information about the fpc-pascal mailing list