Recent

Author Topic: [offtopic] exec a path in pascal  (Read 3793 times)

whitehat

  • Jr. Member
  • **
  • Posts: 93
[offtopic] exec a path in pascal
« on: January 12, 2017, 07:55:04 pm »
i use turbo pascal 1.5 for my school project i try this code to execute a html page but the turbo pascal show me a message (unknown identifier )
Code: Pascal  [Select][+][-]
  1.  
  2. Program Program_;
  3. uses wincrt;
  4. begin
  5.  exec('C:/TPW/exercice/site.htm','');
  6.  readln;
  7. end.
  8.  
« Last Edit: January 13, 2017, 08:30:15 pm by marcov »

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: [UNSOLVED] exec a path in pascal
« Reply #1 on: January 12, 2017, 09:44:52 pm »
TP 1.5 is very old compiler and works only in old operating systems... What operating system are you using?

whitehat

  • Jr. Member
  • **
  • Posts: 93
Re: [UNSOLVED] exec a path in pascal
« Reply #2 on: January 12, 2017, 09:53:43 pm »
windows 7 i just have a project school i wanna execute the html page from a pascal program

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: [UNSOLVED] exec a path in pascal
« Reply #3 on: January 12, 2017, 10:06:59 pm »
Some schools (or teachers) are just too lazy to move on from over 20 years old dead products, sacrificing both the students and the language evolution...

I have no idea about how you could do that in TPW, not even sure if a 16-bit program is allowed to execute 32-bit / 64-bit one, but first: you don't execute a html page, but open it in a browser and let its rendering engine works.

LCLIntf.OpenURL is what you're looking for, but as what this forum is for, you MUST move on from TPW and code in Free Pascal & Lazarus (since LCLIntf unit is part of LCLBase package) instead.

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: [UNSOLVED] exec a path in pascal
« Reply #4 on: January 12, 2017, 10:28:33 pm »
Some schools (or teachers) are just too lazy to move on from over 20 years old dead products, sacrificing both the students and the language evolution...

+1

I can't test TP 1.5 on my Windows 10 because 8086 (16 Bit) applications are unsupported. Old times, Windows NT ships with VM to execute this kind of applications for compatibility... but 16 bits applications were mainly developed for DOS real-mode and Windows 3.1... With the arrival of Windows NT and Windows 95 with kernel protected mode 32 bits are the main focus.

You can discuss your teacher about this.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: [UNSOLVED] exec a path in pascal
« Reply #5 on: January 13, 2017, 02:39:58 am »
i use turbo pascal 1.5 for my school project i try this code to execute a html page but the turbo pascal show me a message (unknown identifier )
Unless specifically for novelty usage/reasons, there is absolutely no point in pursuing TPW endeavours whatsoever. Really, it is a waste of your time.

Someone wished us welcome in 1984 when the new year of 2017 arrived but, i don't think that had to be taken (almost) literally (it is just a few years off)  :)

Is there any particular reason that your school does not allow for using software with an open (and free) license, such as as Free Pascal ?

Some schools (or teachers) are just too lazy to move on from over 20 years old dead products, sacrificing both the students and the language evolution...
I dare to say it is even beyond sacrificing, and a complete waste of time and resources.

The only exception to that (as i've already stated) is in case you're into novelties and still would like to address TPW supported platforms. Things where pretty revolutionary in those day and age but many of the supported technologies do not make any sense whatsoever today.

derek.john.evans

  • Guest
Re: [UNSOLVED] exec a path in pascal
« Reply #6 on: January 13, 2017, 04:08:41 am »
If you really really must, then:

Code: Pascal  [Select][+][-]
  1. uses WinTypes, WinProcs;
  2. begin
  3.      WinExec('cmd /k "c:\index.html"', SW_NORMAL);
  4. end.
  5.  

Or, if you can try stuff like:
Code: Pascal  [Select][+][-]
  1. WinExec('notepad "c:\index.html"', SW_NORMAL);
  2. WinExec('explorer "c:\index.html"', SW_NORMAL);
  3.  

But, as people have said, why use TP1.5 ...

whitehat

  • Jr. Member
  • **
  • Posts: 93
Re: [UNSOLVED] exec a path in pascal
« Reply #7 on: January 13, 2017, 08:27:03 pm »
it's for my school project i know that turbo pascal 1.5 is old but what i can do they teach us the old pascal but can you explain to me what mean 'SW_NORMAL' and cmd /k and WinTypes, WinProcs can you explain

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: [UNSOLVED] exec a path in pascal
« Reply #8 on: January 13, 2017, 08:29:40 pm »
it's for my school project i know that turbo pascal 1.5 is old but what i can do they teach us the old pascal but can you explain to me what mean 'SW_NORMAL' and cmd /k and WinTypes, WinProcs can you explain

I'm sorry, but this question is offtopic. This is a free pascal, not a turbo pascal board, so I'm locking this topic.

If you have problems with your assignment ask your teacher, or try Stack overflow, which is a general programming Q&A site

 

TinyPortal © 2005-2018