Go Premium for a chance to win a PS4. Enter to Win

x

Pascal

Pascal is an influential imperative and procedural programming language, largely (but not exclusively) intended to teach students structured programming and data structuring. Pasca was implemented on a wide range of architectures, from early PCs to mainframes. Pascal derivatives include OOP-based Object Pascal (used in Delphi and Lazarus/Free Pascal). Pascal is a purely procedural language and includes control statements with reserved words, but has many data structuring facilities and other abstractions like type definitions, records, pointers, enumerations, and sets.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello programming experts! I am having a memory problem that cannot explain root cause, please help me! The problem is as follows: My program throws exception when i exit. I investigated and thought that the cause of the error was the use Copymemory function to copy the record containing the variable have string data type.

Below is my demo program by delphi 2009: In my project,  I added 2 file project dpr then add sharedmemory for use BorlndMM.dll instead of using FastMM memory management. I define a struct containing a String variable. Allocate 1 array of 2048 PByte elements. Use Memory Copy function to copy 2 struct. finally, Free array 2048. when i exit program, my program threw exception.
type   
 TMyStructure = record
 F1: TMyStructure;

Open in new window

unit 1
procedure TForm9.FormCreate(Sender: TObject);
var
    i: Integer;
begin
    F1.str1 := 'This is a string to demo for copying the String data type 
                                            using the Copymemory method';
end;

Open in new window

unit 2
procedure TForm8.btn1Click(Sender: TObject);

var
Form9: TForm9;
i: Integer;
s1: array[0..2048-1] of PByte;
begin
    //  Alloc 1st 2048 segments, each segment gain 1KB
    for i := 0 to Length(s1) - 1 do
    begin

    s1[i] := AllocMem(1024);
end;

//  Create Form9
Form9 := TForm9.Create(Owner);

//  -> ERROR
CopyMemory(@Self.F1, @Form9.F1, SizeOf(TMyStructure));

//  -> OK
//  Self.F1 := Form9.F1;

// Free memory s1 array
for i := 0 to Length(s1) - 1 do
begin
    FreeMem(s1[i]);
end;
end;

Open in new window

0
New feature and membership benefit!
LVL 11
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Hi, I've been banging my head with trying to come up with a way on Pascal on how to create a function that saves an array of byte to file while keeping its integrity from the fist to the last byte.

I came up with two ideas, either I save the data to the file in its binary form or I convert the binary to hex then save.
When I need to load, if its hex I can decode and convert it to an array of bytes again.

I'm really stuck, because I looked over alot on the past days and didnt find anything remotely close to it. I've began recently working with Pascal so I'm not that experienced with it.
Going C++ would solve me issue but that is not an option here, I need to do it on Pascal.

So if anyone could come up with a way for me to save the array of bytes then load it again later on I would be really thankful.

I could also use a function to encode/decode the bytes, but i have no clue on how would that work.

This is the array I need to save

hmm: array [0..18954] of BYTE;

I have pretty much no base code cause everything I came up with brings error on the IDE, sorry.
0
I have big problem with StringList. I have text file with text like this:

     
51,179 km=Powiat Ostrzeszowski
    51,179 - 61,402 km=Powiat Wieruszowski
    61,402 - 64,559 km (d. DW450)=Powiat Wieruszowski
    64,559 km (d. DW450)=Powiat Kępiński 

Open in new window


I want to import this file and show first values, before "=" in RadioGroup. Second values after "=" i want to show on Label in moment when user clicks proper value on RadioGroup.

I would like to operate on Names and Values of StrongList.

Something like this: https://i.stack.imgur.com/dkLih.png

In *.pas file I have:

     
var
      Form1: TForm1;
      list: TStringList;
      i: Integer; 

Open in new window


On FormCreate:

   
 list := TStringList.Create;    
    list.LoadFromFile('dat\a1pik.dat');
    RadioGroup1.Visible := true;
    RadioGroup1.Items.Clear;

    for i := 0 to list.Count-1 do
        begin
            RadioGroup1.Items.Add(list.Names[i]);
        end;

And first values I have on RadioGroup. 

Open in new window


I try with RadioGroup like this:

     
procedure TForm1.RadioGroup1Click(Sender: TObject);
        begin
        Label.Caption := list.Values[list.Names[RadioGroup1.ItemIndex]];
        end; 

Open in new window


But doesn't work. What I do wrong?

P.S. Sorry for my English :)
0
Hi, when i use a quick twebbrowser command.
and i use the following link to test a code, it doesnt show.
How can i rectrifie this?

So i put a path in my delphi app to open the link inside the twebbrowser..
after it logs in my acc, and advances to the path, it just shows a black screen.

https://account.xbox.com/en-GB/PaymentAndBilling/RedeemCode?doRedeem=0&token=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
0
Hello Guys I'm new with Delphi which uses pascal language.
I'm trying to create simple application which loaded all values in sMemo.Text. All Strings were working fine except with Boolean values "CheckBox and radio Buttons"
here is the line I'm using
sMemo1.Lines.Add(sCheckBox1.Create );
it gives me an error
[DCC Error] Unit1.pas(44): E2035 Not enough actual parameters.

here is my whole code

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, sCheckBox, sRadioButton, sGroupBox, sButton, sEdit, sMemo,
  sLabel;

type
  TForm1 = class(TForm)
    sMemo1: TsMemo;
    sEdit1: TsEdit;
    sEdit2: TsEdit;
    sEdit3: TsEdit;
    sButton1: TsButton;
    sButton2: TsButton;
    sGroupBox1: TsGroupBox;
    sRadioButton1: TsRadioButton;
    sRadioButton2: TsRadioButton;
    sCheckBox1: TsCheckBox;
    sMemo2: TsMemo;
    sLabel1: TsLabel;
    procedure sButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.sButton1Click(Sender: TObject);
begin
sMemo1.Clear;
sMemo1.Lines.Add(sEdit1.Text);
sMemo1.Lines.Add(sEdit2.Text);
sMemo1.Lines.Add(sEdit3.Text);
sMemo1.Lines.Add(sCheckBox1.Create);
end;
end.


Anyone here knows that. My main purpose with this app is to load all configuration into memo instead of an ini file wich is easy to …
0
i am using this function to find node in treeview

function TFORM1.lookingTreeView(name: String): PVirtualNode;
var
Node: PVirtualNode;
Data: PUserData;
begin
Result := nil;
Node := VDT1.GetFirst;
while ((Node <> nil) and (Result = nil)) do
begin
Data := VDT1.GetNodeData(Node);
if (Data.FObject.name= name) then
begin
Result := Node;
break;
end
else
Node := VDT1.GetNext(Node);
end;
end;

Open in new window


and i use it like so
Node := lookingTreeView(namedata);

if Node <> nil then
begin
// then stop execute the code 
exit;
end;
// if its nil then do execute the rest of code

Open in new window


so this code search for node in Vst and if the node exits stop the code execution and if does not exits do the rest  

but some times this function got bypassed i mean when a node is already exits the if statement of node <> nil does not detect that its not nil and continue executing the code.
0
Good day.

My aim to to design a form similar to the one in the attached image. My problem is that i would like to place forms all over the form but i am unable to do this bacuse my design time form is not as big as the run time maximised form. Is there any solution to this that will allow me to design my GUI using the enitire form, or atleast be able to place components properly on the form.
Screenshot--30-.png
0
Hi,

I have to create a program to communicate with 50 machines.

I'm using ClientSocket, because the machines will be the server connection.

I tried to create dynamically and manually (one-by-one), but after several hours, the error 10055 is appearing.

I tried too create only one connection with unknown IP and the message is happening again.

  if not(ClientSocket1.Active) then
  begin
    ClientSocket1.Socket.Close;
    ClientSocket1.Close;
    ClientSocket1.Active := True;
  end;

I put this inside a button.

About all errors, I created a routine:
procedure TForm1.ClientSocket1Error(Sender: TObject;
  Socket: TCustomWinSocket; ErrorEvent: TErrorEvent;
  var ErrorCode: Integer);
begin
 if ErrorCode>0  then
  begin
    ClientSocket1.Socket.Close;
    ClientSocket1.Close;
    if Socket = ClientSocket1.Socket then ClientSocket1.Active := True;
  end;
end;

This way I was thinking that I could fixed every timeout, but nothing yet.

Please, can someone help me?

Best Regards
Wellington
0
How do I use idhttp to login to instagram also add functionality to like and follow ?
0
Hello,

I have different shortcuts in my program but I want to let the users change the shortcuts, just like in Notepad++ Shortcut mapper.

I like help in following:

- How to implement this in Delphi easily (attaching shortcuts to buttons and actions)
- Directions what is the best method to save and load the users shortcuts in/from database (each user of the same program would have separate shortcut settings).

Thank you in advance.
0
[Webinar] Cloud and Mobile-First Strategy
LVL 11
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

i have this code to insert some node inside Tvirtuailstringtree it works but some time strange behavior happened

this Tvirtuailstringtree  are inside a Tpanel called pnlmc

here is the code


function AddMCVDTMIC(AVST: TCustomVirtualStringTree; ANode: PVirtualNode; AObject: TUMICX): PVirtualNode;
    var
      Data: PUserONMIC;
    begin
      Result := AVST.AddChild(ANode);
      Data := AVST.GetNodeData(Result);
      AVST.ValidateNode(Result, false);
      Data^.FObject := AObject;
    end;

procedure Tform1.Talkin;
var
Node: PVirtualNode;
Data: PUserData;
UMICX : TUMICX;
begin
Node := lookingTreeView(LineToid);
Data := VDT1.GetNodeData(Node);
if (Node <> nil) then
begin
VDT1.IsVisible[Node] := False;
vstmca.BeginUpdate;
try
vstmca.Clear;
UMICX := TUMICX.Create;
try Data.FObject.istalking := '12'; except end;
umicx.Username :=  Data.FObject.Username;
umicx.userUid := Data.FObject.userUid;
umicx.istalking := Data.FObject.istalking;
umicx.color := Data.FObject.color;
umicx.image := Data.FObject.image;

try AddMCVDTMIC(vstmca, nil, umicx);  except end;

finally
  vstmca.EndUpdate;
end;
end;

//

if (recorder.Active = True) and (LineToid = IntToStr(UniqueID)) then
begin
try button1.Visible := false; except end;
try stop1.Visible := True; except end;
end
else if (recorder.Active = false) then // enrecorder check
begin
try button1.Enabled := false; except end;
try button1.Caption := 'streamin'; except end;
end;


try pnlmc.Height := Data.FObject.iHeigh; 

Open in new window

0
i have combobox that have items  like
1
2
3
4

i want to add items based on number so if last item = 4 then add new item with

5
6
7
8

and so on

function Tpnlsettings.findTheme(tName : string): Integer;
var
  I: Integer;
begin
  Result := -1;
  for I := 0 to cmbThemes.Items.Count - 1 do
  begin
    if cmbThemes.Items.Strings[i] = tName then
    begin
      Result := i;
      Break;
    end;
  end;
end;

procedure Tpnlsettings.btnAddThemeClick(Sender: TObject);
var
  I: Integer;
begin
  i := findTheme(intTostr(cmbThemes.items.Count));
  if i <> -1 then
  begin
    cmbThemes.ItemIndex := i;
  end else
  begin
    cmbThemes.Items.Add(intTostr(cmbThemes.items.Count+1));
    cmbThemes.ItemIndex := cmbThemes.items.Count-1;
  end;

  objectEnabled(btnThemeChange,True);
end;

Open in new window


current code fail to add with same approach i needed
0
i have two tvirtualstringtree in a form i wanted to invalidate them using timers

but i stuck with problems it seems that only 1 VST got invalidated and the other one ignored any idear why ?

i use invalidate with current code within timer

procedure Tform1.Timerval1Timer(Sender: TObject);
{$J+}
Const
iCount: Cardinal = 0;
{$J-}
begin
Inc(iCount);
if (iCount * TTimer(Sender).Interval) > 500 then
begin
xbool := NOT xbool;
iCount := 0;
end;
VDT1.Invalidate;
end;

procedure Tform1.Timerval2Timer(Sender: TObject);
{$J+}
Const
iCount: Cardinal = 0;
{$J-}
begin
Inc(iCount);
if (iCount * TTimer(Sender).Interval) > 500 then
begin
xbool := NOT xbool;
iCount := 0;
end;
VDT2.Invalidate;
end;

Open in new window


issue happens when i use beforecellpaint on each VSt

procedure Tform1.VDT1BeforeCellPaint(Sender: TBaseVirtualTree;
  TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
  CellPaintMode: TVTCellPaintMode; CellRect: TRect; var ContentRect: TRect);
var
Data: PUserdataon;
NewRect: TRect;
xOff, yOff: Integer;

begin
GradientFillCanvas(TargetCanvas, clred, clWhite, CellRect, gdHorizontal); // GraphUtil

if not Assigned(Node) then
begin
exit;
end;

Data := vdt1.GetNodeData(Node);

begin
NewRect := CellRect;
NewRect.Left := NewRect.Left + 2;
NewRect.Width := 24;
NewRect.Top := NewRect.Top;
NewRect.Bottom := NewRect.Bottom;
xOff := CellRect.Left + 70;
yOff := CellRect.Top +((30 - TargetCanvas.TextHeight('H')) div 2);
if xbool or (Data.FObject.bool= false) then

Open in new window

0
i have this code to grab node from vst

function form1.lookingTreeView(name: String): PVirtualNode;
var
Node: PVirtualNode;
Data: PUserData;
begin
Result := nil;
Node := VDT1.GetFirst;
while ((Node <> nil) and (Result = nil)) do
begin
Data := VDT1.GetNodeData(Node);
if (Data.FObject.userUid = name) then
begin
Result := Node;
break;
end
else
Node := VDT1.GetNext(Node);
end;
end;

Open in new window


and i use it like so

var
Node: PVirtualNode;
Data: PUserData;
begin
Node := lookingTreeView('123456');
Data := VDT1.GetNodeData(Node);

Open in new window


i want to add this node to another vst list after i find it

lets say my other vst list called VDT2

i want to add the node thet i find from VDT1 To VDT2 and hide it from VDT1

what should i do ?
0
in my previous question i asked for the same question that i am asking now

https://www.experts-exchange.com/questions/28943546/how-do-i-use-on-compare-node-correctly-in-TVirtualStringTree.html

thats my old question. sadly answers did not solve the main issue i have

here is the current code

procedure Tform1.VDT1CompareNodes(Sender: TBaseVirtualTree; Node1, Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
var
Data1, Data2: PUserData;
begin
Data1 := VDT1.GetNodeData(Node1);
Data2 := VDT1.GetNodeData(Node2);

      if (not Assigned(Data1)) or (not Assigned(Data2)) then
      begin //
        Result := 0;
        exit;
      end;


      //hand check  less than

      if (Data1.FObject.Userhand < Data2.FObject.Userhand) and (istalkon=True) then
      begin
        Result := -1;
        memo1.Lines.Add('is old date');
      end
      else
      if (Data1.FObject.Userhand < Data2.FObject.Userhand) and (istalkon=False) then
      begin
      Result := 1;
      end else

       // hand check greater than
      if (Data1.FObject.Userhand > Data2.FObject.Userhand) and (istalkon=True) then
      begin
        Result := -1;
        memo1.Lines.Add('is New date');
      end
      else
      if (Data1.FObject.Userhand > Data2.FObject.Userhand) and (istalkon=False) then
      begin
      Result := 1;
      end else

      //hand check  less than

      if (Data2.FObject.Userhand < Data1.FObject.Userhand) and (istalkon=True) then
      begin
        Result

Open in new window

0
i am using following code to send text data that saved inside memory stream
MS := TMemoryStream(OutboundCmds.Objects[I]);
        if MS <> nil then
        begin
          AContext.Connection.IOHandler.LargeStream := true;
          AContext.Connection.IOHandler.Write(MS, 0, true);
        end;
      end;

Open in new window


its sends text data correctly if its in english

but if its in other language like arabic it comes questions marks like this "?????" what could be the issue ?

here is how i add text to memory stream

procedure TConnection.sendData;
var
  I: integer;
  SL: TStringList;
  MS: TMemoryStream;
begin
  MS := TMemoryStream.Create;
  try
      SL := TStringList.Create;
      try
    begin
        SL.Add('مرحبا');
      end;

       if (SL.Count > 0) then
        begin
          SL.SaveToStream(MS);
          MS.Position := 0;
        end;
      finally
        SL.Free;
      end;
  finally
    MS.Free;
  end;

end;

Open in new window

0
I am using Threads programming for the first time.
Can use the below mentioned Private variable 'sysAbort' as done below ?
Can I use sysNum Local Variable as done below ?
(I will be running only one instance of the thread at a time)


  private
    { Private declarations }
    sysAbort:Boolean ;

procedure TForm3.button_StartClick(Sender: TObject);
var
  sysNum:Integer ;
begin
  sysAbort:=False ;
  sysNum:=0 ;
  memo1.lines.add('Starting') ;
  with TThread.CreateAnonymousThread(
    procedure
    var
      MaxValue:Int64 ;
      I: Integer;
      Total: Integer;
    begin
      MaxValue:=1000 ;
      for I := 1 to MaxValue do
      begin
        if sysAbort then  // Can I use thus ?
          break ;
        sysNum:=I ;  // Can I use local variable
        // memo1.lines.Add('Violated  ' + Inttostr(sysNum)) ;  // This works too !
        if (I * 10 mod MaxValue) = 0 then
          TThread.Synchronize (TThread.CurrentThread,
            procedure ()
            begin
              memo1.lines.Add('Progress : ' + Inttostr(I)) ;
            end);

        sleep(10) ;   // just for delay
      end;

      TThread.Synchronize (TThread.CurrentThread,
        procedure ()
        begin
          memo1.lines.Add('End of process : ' + IntToStr(sysNum));
        end);
    end

  ) do
  begin
    OnTerminate := ThreadFinished ;
    Start;
  end;
end;

procedure TForm3.ThreadFinished(Sender: TObject);
begin
  if TThread(Sender).FatalException = nil then begin
    

Open in new window

1
i have this function that detect fast click

  function IsFlood:Boolean;
  var
  i, x : integer;
  begin
    Result := False;
    i := trunc(GetTickCount/2);
    x := trunc((i - LastFloodTime)/4);
    Result := False;
    if x < 180 then Result := True;
    LastFloodTime := i;
  end;

Open in new window


this function uses GetTickCount i want to use Tstopwatch instead any one can convert this function to Tstopwatch ?
1
i have this idhttp code that download images to memory stream and save it on disk

i want to convert jpeg images and png to GIF then save them to disk

if (itsimage = 'image/jpeg') or (itsimage = 'image/png') or (itsimage = 'image/gif') then
begin
try
aIdHttp.Get(trim(FURL), aMs);
except
end;
aMs.SaveToFile(path);
end;

try
if aIdHttp.Connected then
aIdHttp.Disconnect;

except // do not care about any errors yet, maybe log them later

end;

Open in new window

1
Hire Technology Freelancers with Gigs
LVL 11
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

You can tell I'm a newbie. But everyhthing I've read tells me this should work.

unit AdvertisingAnalysisU;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, pngimage, StdCtrls, jpeg, ExtCtrls, ComCtrls;

type
  TForm19 = class(TForm)
    Button1: TButton;
    Procedure GetAdvertisingSpend;


     private
    { Private declarations }

  public
    { Public declarations }

  end;

var
  Form19: TForm19;

implementation

{$R *.dfm}

Procedure GetAdvertisingSpend;
var a: integer;
begin
  a:=1;
end;
end.


So I get the message unsatisfied forward or external declaration on the GetAdvertisingSpend procedure.
1
i have a server that client connect To .   each client on server have its own mydac TMyConnection. but every time new client connect to server old clients have the new client data base which is wrong step here is my server code

type
  TConnection = class(TIdServerContext)
  private
    // WriteLock: TCriticalSection;
    dbconnect: TMyConnection;

  public
    OutboundCache: TIdThreadSafeStringList;
    Name: String;
    Databasename : string;

    constructor Create(AConnection: TIdTCPConnection; AYarn: TIdYarn;
      AList: TIdContextThreadList = nil); override;
    destructor Destroy; override;


constructor TConnection.Create(AConnection: TIdTCPConnection; AYarn: TIdYarn;
  AList: TIdContextThreadList = nil);
begin
  inherited;
  // WriteLock := TCriticalSection.Create;
  OutboundCache := TIdThreadSafeStringList.Create;
  dbconnect := TMyConnection.Create(nil);
  dbconnect.Pooling := true;
  dbconnect.PoolingOptions.Validate := true;
  dbconnect.Server := 'localhost';
  dbconnect.username := 'root';
  dbconnect.Password := 'password';
  dbconnect.ConnectionTimeout := 0;
  connectionmo.userslq.Connection := dbconnect;
end;

destructor TConnection.Destroy;
var
  Cache: TStringList;
  I: integer;
begin
  // WriteLock.Free;
  if OutboundCache <> nil then
  begin
    Cache := OutboundCache.Lock;
    try
      for I := 0 to Cache.Count - 1 do
        Cache.Objects[I].Free;
    finally
      OutboundCache.Unlock;
    end;
    OutboundCache.Free;
  end;
  inherited;
end;

Open in new window


Server execute



Open in new window

0
i have this code that send data to each client connected where client value equals to something

procedure TConnection.BroadCastTextMessage(const TextMessage: String;
const FromUniqueID: Dword; const FromName: string);
var
  List: TList;
  I, J: integer;
  Connection: TConnection;
  Channel: string;
begin
  List := Server.Contexts.LockList;
  try
    for I := 0 to List.Count - 1 do
    begin
      Connection := TConnection(List.Items[I]);
      if Connection.UniqueID = FromUniqueID then
      begin
        Channel := Connection.Channel;
        for J := 0 to List.Count - 1 do
        begin
          Connection := TConnection(List.Items[J]);
          if (Connection <> Self) and (Connection.Channel= Channel) then
          begin
            try
              Connection.SendCommandWithParams('TEXTMESSAGE',
                FromName + Sep + TextMessage + Sep);
            except
            end;
          end;
        end;
        Exit;
      end;
    end;
  finally
    Server.Contexts.UnlockList;
  end;
end;

Open in new window


this code brodcats  a text to each client connected where this client channle variable equals to sender is this the best way to do  ? also i want to add more stuff like if (Connection <> Self) and (Connection.Channel= Channel)  and connection.otherdata = same data to each client connected should i use self.otherdata then ?
0
is this bad setting in delphi ide ? or some mistake of mine ? my exe application get too long to be able to right click on it and my processor gets to hiegh if  try to move it from folder to another or even right click to copy

this issue happend with each exe project i made with Delphi even empty projects . the Antimalware execute on windows 8 takes to long and high process to verify the exe that maded with delphi

other exe on disk never hang on what could be the issue ?
0
any way to create html5 client that can connect to tidtcpserver and exchange data between it  ?

i found this component http://websockets.esegece.com/

 but dont know how to mirage it to my server application

any sample code can be provided ?
0
i currently have this parse function to parse strings inside string list


procedure admlistparse(starting: string; var Username, Access: string);
var
  P, I: Integer;
begin
  I := 0;
  repeat
    P := Pos(Sep, starting);
    if P <> 0 then
    begin
      Inc(I);
      case I of
        1: Username := Copy(starting, 1, P - 1);
        2: Access := Copy(starting, 1, P - 1);
      end;
      Delete(starting, 1, P + Length(Sep) - 1);
    end;
  until (I = 2) or (P = 0) or (starting = '') end;

procedure Tform1.gettextfromms;
    var
      I: Integer;
      starting: string;
      Username, Access: String;
      SL: TStringList;
    begin
      if Assigned(Ms) then
      begin
        SL := TStringList.Create;
        try
          SL.LoadFromStream(Ms);
          for I := 0 to SL.Count - 1 do
          begin
            starting := SL.Strings[I];
            admlistparse(starting, Username,  Access);
              memo1.Lines.Add('Username : ' + SL.Strings[I]);
          end;
        finally
          SL.Free;
        end;
      end;

    end;

Open in new window


now get text from MS procedure should get text like this

Drama#$%^&1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s1:s#$%^&

Open in new window


So i use #$%^& as separator to get this string as tow lines or maybe more if there is other string inside it

but i had on e issue that name Drama comes with second empty string any idea why ?
1

Pascal

Pascal is an influential imperative and procedural programming language, largely (but not exclusively) intended to teach students structured programming and data structuring. Pasca was implemented on a wide range of architectures, from early PCs to mainframes. Pascal derivatives include OOP-based Object Pascal (used in Delphi and Lazarus/Free Pascal). Pascal is a purely procedural language and includes control statements with reserved words, but has many data structuring facilities and other abstractions like type definitions, records, pointers, enumerations, and sets.

Top Experts In
Pascal
<
Monthly
>

No Top Experts for this time period. Answer questions to earn the title!