Category : Pascal Source Code
Archive   : TPCM9406.ZIP
Filename : CODE050.PAS

 
Output of file : CODE050.PAS contained in archive : TPCM9406.ZIP
{
SD>Anyone have a procedure to convert an array of strings to an array of char ?

It's easier than you think! A string = array [0 ..255] of char. Or, in
your examples, a string[80] = array [0 .. 80] of char. (What is in position
0, you might ask? That char indicates how long the string is.)

SD>I have e.g.
SD>
SD>Bericht : Array [1..100] of String[80];
SD>Message : Array [1..8000] of Char;

SD>How do I convert whatever is in Bericht to Message ? And once I did that, how
SD>do I convert Message back to an Array of String ???

I haven't actually tested this code, but:
}

procedure Bericht_zur_Message;
var i, j: byte;
begin
for i := 1 to 100 do begin
for j := 1 to 80 do begin
Message[80*(i - 1) + j] := Bericht[i, j];
end;
end;
end;

procedure Message_zum_Bericht;
var i, j: byte;
begin
for i := 1 to 100 do begin
for j := 1 to 80 do begin
Bericht[i, j] := Message[80*(i - 1) + j];
end;
end;
end;

{
Note: I have not put in any code to read or write the "length" chars in
each string. I'm not sure how you would want that done ...

----
* Origin: PC-OHIO - Best BBS in America 1-216-381-3320 (1:157/200)
}

  3 Responses to “Category : Pascal Source Code
Archive   : TPCM9406.ZIP
Filename : CODE050.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/