TIP: Click on subject to list as thread! ANSI
echo: win95
to: ALL
from: IGNATIUS
date: 2019-01-31 19:20:16
subject: MPL

So, i'm trying to write an MPL. The following script compiles, but doesn't run.
It displays "Ia! Cthulhu!" about a dozen times, then locks up. If
anyone out
there can tell me what's wrong with this script, please let me know. Thanks
for any and all help.



#### begin ##################################################################

uses 
cfg,
user;

var  Twriters : array[1..10] of string;
var  Toneliner: array[1..10] of string;
var  S        : string;
var  foneline : string;
var  Ch       : char;
var  Ch2      : char;
var  Count    : byte;
var  Count2   : byte;
var       f   : file;

// begin show procedure ######################################

// Foneline := cfgDataPath + 'oneliner.lst'

Procedure show()
Begin
  clrscr
  dispFile('oneh.ans');
  For Count := 1 To 10 do
  Begin
    write('þ ');
    write(padRT(Toneliner[count], 64, ' '));
    write(' : ');
    writeln(padRT(Twriters[count], 10, ' '));
  End
End
 
// end bot_bar procedure ######################################
// begin top_bar procedure ####################################

Procedure top_bar();
Begin
  dispfile('oney.ans');
  Ch2 := ReadKey;
  If Ch2 = #13 then
  Begin  
    dispFile('oneline.asc');
    Write(': ');
    S := stripmci(Input(70, 70, 11, ''));
    If S = '' then
      WriteLn('aborted');
    Halt
  End

  For Count := 1 To 9 do
  Begin
    Count2 := Count + 1;
    Toneliner[count] := Toneliner[count2];
    Twriters[count] := Twriters[count2];
  End

  tWriters[10] := userAlias;
  tOneliner[10] := S;

  fassign(f, foneline, 66);
  freset(f);
  For Count := 1 To 10 do
  Begin
    fWriteLn(f, tOneliner[count]);
    fWriteLn(f, tWriters[count]);
  End
  fClose(f);
  
  show();
End

// end top_bar procedure ######################################
// begin position procedure ###################################

Procedure position();
begin
  Repeat
    DispFile('onen.ans');

    Ch := ReadKey;
    If IsArrow and Ch = #80 then
    Begin
      dispfile('onen.ans');
      top_bar();
    End
    Else if IsArrow and Ch = #72 then 
      top_bar();

  Until Ch = #13;
End

Procedure bot_bar();
begin
  dispFile('onen.ans');
  Ch2 := ReadKey
  If Ch2 = #13 then
    MenuCmd('go', 'main');
  Halt;
End

// end position procedure ##########################################

// This starts the main program here.
Begin

  If Not fileExist(foneline) Then
  Begin
    fassign(f, foneline, 66);
    fReWrite(f);
    For count := 1 To 10 do
    begin
      fWriteLn(f, 'Ia! Cthulhu!');
      fWriteLn(f, 'ignatius');
    End
    fClose(f);
  End

  Foneline := cfgDataPath + 'oneliner.lst'

  fassign(f, foneline, 66);
  freset(f);
  For Count := 1 To 10 do;
  Begin
    fReadLn(f, Toneliner[count]);
    fReadLn(f, Twriters[count]);
  End
  fClose(f);
  
  show();

  // end show procedure #########################################
  // begin bot_bar procedure ####################################
 
End

Done

## end ######################################################################

TIA,

|09ignatius |07(|15cia|07/|15scrollz|07)

--- Mystic BBS v1.10 A51 (Linux)
 þ Synchronet þ thePharcyde_ >> telnet://bbs.pharcyde.org (Wisconsin)
* Origin: catch22bbs.com (46:1/124)
SEEN-BY: 19/33 103/705 124/5013 5014 5015 5016 130/803 154/10 203/0 221/0
SEEN-BY: 229/275 426 261/38 280/464 5003 292/624 396/40 45 423/120 633/267 280
SEEN-BY: 640/1384 712/132 620 848 770/1 31999/99
@PATH: 124/5013 5014 396/45 280/464 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.