Logo Море(!) аналитической информации!
IT-консалтинг Software Engineering Программирование СУБД Безопасность Internet Сети Операционные системы Hardware
Архив форумов ЦИТФорума
Море(!) вопросов - Море(!) ответов
 
 FAQFAQ   ПоискПоиск   ПользователиПользователи   ГруппыГруппы   РегистрацияРегистрация 
 ПрофильПрофиль   Войти и проверить личные сообщенияВойти и проверить личные сообщения   ВходВход 
Как правильно задавать вопросы

Программисты, не проходите мимо!

 
Перейти:  
Этот форум закрыт, вы не можете писать новые сообщения и редактировать старые.   Эта тема закрыта, вы не можете писать ответы и редактировать сообщения.    Список форумов Архив форумов ЦИТФорума -> Курилка
Предыдущая тема :: Следующая тема  
Автор Сообщение
sniper::p



Зарегистрирован: 04.10.2005
Сообщения: 237
Откуда: rus/73

СообщениеДобавлено: Чт Янв 25 2007 03:15    Заголовок сообщения: Программисты, не проходите мимо! Ответить с цитатой

Попробуйте сохранить следующий код в ascii кодировке и откройте паскалем 70/71. Smile
Код:
{ New Borlont Poskal 95 example program.
  This program lets you use new Borlont Poskal 95, which was built-in in the
  Borland Pascal 7.0. (I guess even developers didn't know about it.)
  It can be switched on by using double comments the [see below] way }
program external(private,public); { you can specify type of your program.
This is done in Borland Pascal 7.0, but when using Borlont Poskal 95, it
receives new meaning }

{ now, enable Borlont Poskal 95 syntax }
const forward = ^{; (* this string enables Borlont Poskal 95 }
{ now all the syntax of the new Poskal 95 can be used. Look through these
examples to find new features }
      private =  { Assign Private Action }
      BEGIN
        in case of export, do not object to destructor and goto library
      END;
      public =   { Assign Public Action }
      BEGIN
        goto do program and begin with absolute packed unit in assembler
      END;

type program = unit; { you can give any name to your identifiers }
     program = library; { you can redefine any type as many times }
     program = program; {                           as you want }
     type = var; { you can define type "type" }
     type = const;

var program : program; { you can redefine variables too }
    program : program with library; { you can use any syntax you want }
    program : program with unit;
    var : program; { you can even define variable "var" }
    var : const;
    var : type;

const program : program = program or unit and library;
      program : program = unit with library in program;
      const : const = type shl string in unit shr and;

{ new free object definition }
type object = object (do not object to object)
       constructor begin; external in library program;
       destructor end; assembler with program;
       procedure function; interrupt with assembler;
       function procedure:constructor; packed assembler unit in program;
     and end;

{ Now execute program with predefined constants (what does it mean?) }
do PROGRAM external ( const private, const public );
{ new function/procedure definition - you don't have any restriction to
function/procedure definition now! }
Function Function (Function:Function):Function; Function and Not Procedure;
 FUNCTION BEGIN
   Function:=Program(Unit Near.External(Far));
 FUNCTION END
Procedure Function (far,near : object) : function or procedure;
 begin
   Function(or procedure):=far far far far in program;
 and; { even if you mixed "end" with "and", compiler will understand it }
{ new "if" statement - no any restriction to the syntax }
IF procedure or function far far in program THEN
while repeat do repeat while;
{ You can construct any operator via constructors and destructors
(again, no restriction to the syntax) }
Constructor And (in library) : And:=library.and;
Destructor Constructor (Procedure : Function) : Program; Var;
{ New Great Assembler! Allows to write everything in words }
asm
  1. Write Message "Formatting disk C" on the screen
  2. Format Disk C (and also ignore all the Windows tries to stop it)
  3. Physically destroy hard drive
  4. Connect to the Internet
  5. Cheat Pentagon
  6. Download secret plans to the disk A:
  7. Disconnect and destroy computer (along with everything in 10 000 km^2
     around)
  8. Finish
end;
{ and at last, very free syntax. Just write everthing you want and
compiler will understand what you meant }
array begin:case[const] of constructor ...
destructor div do downto else end
exports file for function goto
if implementation in inherited inline then interface label library mod nil
not object or packed procedure program record repeat
set shl string to type shr
unit until uses var
while with xor
{ The only bad thing about Borlont Poskal 95 extension is the next:
Your program will NEVER run (although will ALWAYS compile) ;) guess why? :) }

(* And now, switch back to the Borland Pascal 7.0 with uncomment :*)

{ next lines are written in Borland Pascal 7.0. }
type far = string;

function near(far:far):far;far;
begin
  external.near:=external.far(far);
end;
{ you can also switch to the Poskal 95 extension with next line: }
const assembler = ^'; { '
begin
uses program external in unit forward xor string with far far in near
end. (* it is not end of program *)
(* another feature: number of begin's and end's doesn't have to match *)
procedure constructor and destructor(function:function and procedure);
begin
  if constructor then destructor else function in constructor;
    end:
    end;
    end,
    end.
end.
begin. begin. begin, begin begin(begin(end)).
asm
  (c) Pavel Anokhin 1999
  Net Mail: 2:5027/16.20
  E-Mail: mna@valley.ru
end and begin;
{ ok, I think that's enough, switch back to BP7 with next character:}
{ we're back in BP. Enjoy :)  Pascal rulezzzz forever!!! }

begin
  near(forward);
end.

ЗЫ Главное, не забудьте скомпилировать Wink
_________________
Нет предела совершенствованию
Вернуться к началу
Посмотреть профиль Отправить личное сообщение Отправить e-mail
Показать сообщения:   
Этот форум закрыт, вы не можете писать новые сообщения и редактировать старые.   Эта тема закрыта, вы не можете писать ответы и редактировать сообщения.    Список форумов Архив форумов ЦИТФорума -> Курилка Часовой пояс: GMT + 3
Страница 1 из 1

 
Перейти:  
Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах


Powered by phpBB © 2001, 2002 phpBB Group
Русская поддержка phpBB

 

IT-консалтинг Software Engineering Программирование СУБД Безопасность Internet Сети Операционные системы Hardware

Информация для рекламодателей PR-акции, размещение рекламы — adv@citforum.ru,
тел. +7 495 6608306, ICQ 232284597
Пресс-релизы — pr@citforum.ru
Послать комментарий
Информация для авторов
This Web server launched on February 24, 1997
Copyright © 1997-2000 CIT, © 2001-2006 CIT Forum
Внимание! Любой из материалов, опубликованных на этом сервере, не может быть воспроизведен в какой бы то ни было форме и какими бы то ни было средствами без письменного разрешения владельцев авторских прав. Подробнее...