Recent

Author Topic: trying to compile old source code (Satellite Tracking Software)  (Read 1742 times)

TRon

  • Hero Member
  • *****
  • Posts: 536
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #15 on: July 12, 2020, 09:30:12 pm »
Offtop.
Why are use using Geany editor? CudaText is better (link in signature). It also can run the FPC to compile,
https://wiki.freepascal.org/CudaText#External_Tools
Sorry, also off topic.

I have tried on 3 separate occasions to get myself familiar with cuda-text but, I am already lost when looking at the empty editor window  :-[

Maybe it is because I'm used to traditional text editors, but I seem unable to find my way through all options and settings. Quite honestly, the whole editor confuses the hell out of me. Because I have seen some screen-shots of the editor in action, I know it looks pretty cool and is perhaps pretty easy to work with, but I would probably require a brain-wash or other mental reset to be able to make it work for me.

juanirias

  • Jr. Member
  • **
  • Posts: 58
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #16 on: July 12, 2020, 10:49:53 pm »
Maybe can help me with the cursor procedures

As you're already using the unit Crt you can use the existing CursorOn and CursorOff functions.

Dont work under linux ?!

juanirias

  • Jr. Member
  • **
  • Posts: 58
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #17 on: July 12, 2020, 10:52:20 pm »
Offtop.
Why are use using Geany editor? CudaText is better (link in signature). It also can run the FPC to compile,
https://wiki.freepascal.org/CudaText#External_Tools

I don't have money: my laptop is an used OLD lenovo T61p (2009)...
I use a special linux for OLD machines, the GEANY is optimized for low resources ...


PascalDragon

  • Hero Member
  • *****
  • Posts: 2135
  • Compiler Developer
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #18 on: July 13, 2020, 09:45:06 am »
Being an old program like it is, I used OLD documentation which falls under IO errors, 106 = bad Input..

But juanirias used FPC to compile it, thus it's FPC's documentation that applies.

Maybe can help me with the cursor procedures

As you're already using the unit Crt you can use the existing CursorOn and CursorOff functions.

Dont work under linux ?!

Then it can be that your terminal does not handle the command or expects a different one.

juanirias

  • Jr. Member
  • **
  • Posts: 58
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #19 on: July 13, 2020, 11:35:17 pm »
Yes!
I cannot use https://en.wikipedia.org/wiki/Box-drawing_character
I can use to compile but when execute I see a strange symbols...

greetings, JUAN

winni

  • Hero Member
  • *****
  • Posts: 1812
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #20 on: July 13, 2020, 11:47:03 pm »
Hi!

Those are the Box Drawing Signs from Turbo Pascal time with IBM-8-Bit -  also called OEM.

Now we all use UTF8.

Just put them as const in your code:

Code: Pascal  [Select][+][-]
  1. const
  2. MyBlock = '╬';
  3.  

Box Drawing in UTF8 are now in range U+2500 .. U+257F

Winni


jamie

  • Hero Member
  • *****
  • Posts: 3537
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #21 on: July 13, 2020, 11:50:52 pm »
I suppose you can't use CodePage 437 ?

It's needed here in windows if I want to draw those characters .
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 3537
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #22 on: July 14, 2020, 12:01:18 am »
I have an old original console program from a college that I was able to write a windows CRT for and get it to show the old style boxes, lines etc. this is all done within a Windows app but it has a CRT form and all console type output is put there. It includes the blinking cursor etc.

 I don't know if this can work in a Linux GUI setup but I will attach the publish part of it here if you wish so you can look at it.
The only true wisdom is knowing you know nothing

juanirias

  • Jr. Member
  • **
  • Posts: 58
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #23 on: July 14, 2020, 12:03:22 am »
Hi!

I attached a picture, you can see I use in the source code, but don't work on terminal....


juanirias

  • Jr. Member
  • **
  • Posts: 58
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #24 on: July 14, 2020, 12:06:12 am »
attached with common keyboard symbols, the most pretty that I can do for the moment....

jamie

  • Hero Member
  • *****
  • Posts: 3537
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #25 on: July 14, 2020, 12:12:34 am »
I do this in the code for the CRTFOrm

Code: Pascal  [Select][+][-]
  1.    LS := lconvEncoding.cp437ToUTF8(S[Z]);  
  2.  

Basically the S is the string for the output message.
This will convert the CodePage437 chars over the UTF8 and thus should print the desired shape
The only true wisdom is knowing you know nothing

juanirias

  • Jr. Member
  • **
  • Posts: 58
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #26 on: July 14, 2020, 12:20:20 am »
They use a string
Code: Pascal  [Select][+][-]
  1.  DFrame : string = '/=\|\/7890-';     {Double-Line Frame Characters}

Because the choose is like a index...

Code: Pascal  [Select][+][-]
  1.  
  2. Procedure FrameWindow(x,y,w,h,color : byte;
  3.                               title : string);
  4.   var
  5.     i : byte;
  6.   begin
  7. {  Window(x,y,x+w+3,y+h+1);}
  8. {  ClrScr; }
  9.   Window(x,y,x+w+3,y+h+2);
  10.   TextColor(color);
  11.   Write(DFrame[1]);
  12.   for i := 1 to w+2 do
  13.     Write(DFrame[2]);
  14.   Write(DFrame[3]);
  15.   for i := 1 to h do
  16.     begin
  17.     GotoXY(1,i+1);
  18.     Write(DFrame[4]);
  19.     GotoXY(w+4,i+1);
  20.     Write(DFrame[4]);
  21.     end; {for i}
  22.   GotoXY(1,h+2);
  23.   Write(DFrame[5]);
  24.   for i := 1 to w+2 do
  25.     Write(DFrame[2]);
  26.   Write(DFrame[6]);
  27.   GotoXY(2,1);
  28.   Write(MFrame[4],Copy(title,1,w),MFrame[6]);
  29.   NormalVideo;
  30.   end; {Procedure FrameWindow}
  31.  
  32.  


Some advice ?

regards, JUAN

jamie

  • Hero Member
  • *****
  • Posts: 3537
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #27 on: July 14, 2020, 12:33:17 am »
Those characters need to be stored in a RawBytestring so the compiler does not attempt to
convert over to UTF8;

  I think the better choice would be to build a RawBytestring from single character values
or maybe Byte values to reduce the chance of converting it.

  But when you get ready to display it you can index out of this RawBytestring the value you need and then pass it to the iconvEncoding so it will generate a UTF8 output of it.

 So just use the ASCII Extended set values for the images you want and build a RawString instead.
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 3537
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #28 on: July 14, 2020, 12:40:27 am »
lconvEncoding

you need that unit in the uses list, forgot sorry..
The only true wisdom is knowing you know nothing

winni

  • Hero Member
  • *****
  • Posts: 1812
Re: trying to compile old source code (Satellite Tracking Software)
« Reply #29 on: July 14, 2020, 12:42:24 am »
Hi!

No idea in which  number space they are.
The detailed information for the double line frame in UTF8 is:

U+2551

E29591       //hex
14849425  //decimal
║      // HTML

Goto this page, than select codeblock U+2500 ff and select your signs and replace them in your code.

https://www.utf8-chartable.de/unicode-utf8-table.pl

Winni







 

TinyPortal © 2005-2018