Sponsored Content
Full Discussion: pascal and C
Top Forums Programming pascal and C Post 302141641 by Milla on Sunday 21st of October 2007 04:12:00 AM
Old 10-21-2007
pascal and C

Hi I don't understand syntax of pascal and I have some code in pascal. I will be very lucky, when someone could to rewrite into C.

procedure ListInit (var L:TList);
begin
L.Act:=nil;
L.Frst:=nil
end; (* ListInit *)

procedure InsertFirst(var L:Tlist,El:TEl);
var
UkPomEl:TUk;
begin
new(UkPomEl); (* Create a new element *)
UkPomEl^.Data:=El; (* Setting date folder *)
UkPomEl^.UkNasl:=L.Frst; (* Uk is pointer, where is beginning *)
L.Frst:=UkPomEl; (* Beginning pointig to new element *)
end; (* InsertFirst *)

procedureFirst(var L:TList);
begin
L.Active:=L.First(* First become active; in empty list without changes *)
end; (* First*)

functionActive(L:TList):Boolean;
begin
Active:=L.Act<>nil
end; (* Active*)

procedure PostInsert (var L:Tlist; El:TEl);
var PomUk:Tuk;
begin
if L.Act <> nil then begin (* Only for active list *)
new(PomUk);
PomUk^.Data:=El;
PomUk^.UkNasl:=L.Act^.UkNasl; (* New element pointing at the *)
(* same place, where active element poiniting too*)
L.Act^.UkNasl:= PomUk (* Active element pointing to the new element *)
end;

procedure Copy (L:Tlist; var El:TEl);
(* Operation suppose handling of activity of list in form: if Active(L) then begin
Copy(L,El); ... Copy in nonactive list evoke a mistake *)
begin
El:= L.Act^.Data
end;

procedure Actualize (var L:Tlist; El:TEl);
begin
if L.Act<> nil
then begin
L.Act^.Data:=El
end
end;

procedure PostDelete(var L:Tlist);
var
PomUk:Tuk;
begin
if (L.Act<>nil)
then
if L.Act^.UkNasl <> nil
then begin (* something can be canceled out *)
PomUk:=L.Act^UkNasl; (* Pointer to the canceled element *)
L.Act^.UkNasl:=PomUk^.UkNasl; (* Bypass of canceled element *)
Dispose(PomUk)
end (*if L.Act^.UkNasl<> *)
end (*if L.Act <> *)
end;


Thank for all for hepl
Milla
 

2 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Traversing Pascal/Delphi code using GVim

Hi, I am using GVim as editor... and i am viewing code of pascal/ delphi.. my problem is its difficult to use GVim as source code browser.... normally ctags helps to traverse in vim for c/c++.. is there anything like that for pascal/ delphi to minimise this complication of each... (0 Replies)
Discussion started by: SankarV
0 Replies

2. Shell Programming and Scripting

need help in writing shell script to generate pascal's triangle

Hi :) I am learning shell scripting, I need help, I would like to have a script that produces pascal's triangle as shown in the picture http://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Pascal%27s_triangle_5.svg/250px-Pascal%27s_triangle_5.svg.png plz, help it's urgent thanks in... (1 Reply)
Discussion started by: angel1
1 Replies
RasterComp(3U)						    InterViews Reference Manual 					    RasterComp(3U)

NAME
RasterComp, RasterView, PSRaster - raster component subject, view, and PostScript external representation SYNOPSIS
#include <Unidraw/Components/rastercomp.h> DESCRIPTION
RasterComp is a GraphicComp that represents a raster image. It uses a RasterRect graphic to store its graphical attributes. RasterView is a GraphicView for displaying the raster image. PSRaster is a PostScriptView that externalizes the subject's information in PostScript form. RASTERCOMP PUBLIC OPERATIONS
RasterComp(RasterRect* = nil, const char* filename = nil) The constructor takes an optional RasterRect structured graphic that defines the attributes of the raster image. You can also sup- ply an optional file name to associate the component with a file containing the (copious) image data. RasterRect* GetRasterRect() Return the RasterRect graphic that defines the raster's attributes. GetRaster is simply a more specific form of the GetGraphic operation. const char* GetFileName() Return the file name specified in the constructor, if any. RASTERVIEW PUBLIC OPERATIONS
RasterView(RasterComp* = nil) Create an RasterView, optionally supplying the subject. RasterComp* GetRasterComp() Return the subject. PSRASTER PUBLIC OPERATIONS
PSRaster(RasterComp* = nil) Construct a PostScript external representation of the given subject, if any. SEE ALSO
GraphicComp(3U), GraphicView(3U), PostScriptView(3U), RasterRect(3U) Unidraw 10 August 1991 RasterComp(3U)
All times are GMT -4. The time now is 07:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy