Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2007-01

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

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bisma Jayadi

-------- 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
Reply-To:
Organization: UPPTI Unibraw
To: Milis PSP

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

Reply by email