Recent

Author Topic: [SOLVED]Using software that is no longer supported and tryi  (Read 372 times)

needpascalhelp

  • New member
  • *
  • Posts: 5
I tried to edit some code to add a form in some software I am using that is no longer supported.  I deleted the form and changed the code back to what it was and am now getting a 'BEGIN' expected error and I dont see why I need it in the code.  I have put the code below.  Its referencing the last line 175:1 (not shown here but in the error that pops up).  Its in this portion of the code.


procedure Button1OnClick(Sender: TfrxComponent);
begin
  if Checkbox_InvoiceC.checked = true  then
       InvoiceC.visible := true
  else
       InvoiceC.Visible := False;

  if Checkbox_InvoiceM.checked = true  then
       InvoiceM.visible := true
  else
       InvoiceM.Visible := False;

  if Checkbox_CCAuth.checked = true  then
       CCAuth.visible := true
  else
       CCAuth.Visible := False;

  if Checkbox_PackingSlip.checked = true  then
       PackingSlip.visible := true
  else
      PackingSlip.Visible := False;

   if CheckBox_CofCC.checked = true  then
       CofCC.visible := true
  else
      CofCC.Visible := False;

    if CheckBox_CofCA.checked = true  then
       CofCA.visible := true
  else
      CofCA.Visible := False;

     if CheckBox_CofCM.checked = true  then
       CofCM.visible := true
  else
      CofCM.Visible := False;
                   
     if CheckBox_Terms.checked = true  then
       Terms.visible := true
  else
      Terms.Visible := False;
     
  end; 

Was hoping someone can give me some incite on how to fix it. 
« Last Edit: June 06, 2019, 12:23:29 am by needpascalhelp »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7302
I don't immediately see anything wrong with it. The common pitfall, putting a ";" before else seems to be ok in this piece.

So it might be outside the shows code, before or after.

needpascalhelp

  • New member
  • *
  • Posts: 5
Here is  the before but there is nothing after.

var
ntimes,i:integer;

procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
begin
  if engine.freespace < reportsummary1.height then
  begin
    while engine.freespace > Child1.height do
    begin
      engine.showband(Child1);
    end;
    engine.newpage;
  end;

  if engine.freespace > ReportSummary1.height then
  begin
    if engine.freespace > ReportSummary1.height + child1.height then
    begin
      ntimes := int((engine.freespace-reportsummary1.height)/child1.height);
      for i := 1 to ntimes do
      begin
        engine.showband(Child1);
      end;
      engine.cury := engine.pageheight -reportsummary1.height - pagefooter1.height-1;
    end;
  end;
end;

procedure ReportSummary2OnBeforePrint(Sender: TfrxComponent);
begin
  if engine.freespace < reportsummary2.height then
  begin
    while engine.freespace > Child2.height do
    begin
      engine.showband(Child2);
    end;
    engine.newpage;
  end;

  if engine.freespace > ReportSummary2.height then
  begin
    if engine.freespace > ReportSummary2.height + child2.height then
    begin
      ntimes := int((engine.freespace-reportsummary2.height)/child2.height);
      for i := 1 to ntimes do
      begin
        engine.showband(Child2);
      end;
      engine.cury := engine.pageheight -reportsummary2.height - pagefooter3.height-1;
    end;
  end;
end;

procedure ReportSummary3OnBeforePrint(Sender: TfrxComponent);
begin
  if engine.freespace < reportsummary3.height then
  begin
    while engine.freespace > Child3.height do
    begin
      engine.showband(Child3);
    end;
    engine.newpage;
  end;

  if engine.freespace > ReportSummary3.height then
  begin
    if engine.freespace > ReportSummary3.height + child2.height then
    begin
      ntimes := int((engine.freespace-reportsummary3.height)/child3.height);
      for i := 1 to ntimes do
      begin
        engine.showband(Child3);
      end;
      engine.cury := engine.pageheight -reportsummary3.height - pagefooter4.height-1;
    end;
  end;
end;

procedure ReportSummary5OnBeforePrint(Sender: TfrxComponent);
begin
  if engine.freespace < reportsummary5.height then
  begin
    while engine.freespace > Child5.height do
    begin
      engine.showband(Child5);
    end;
    engine.newpage;
  end;

  if engine.freespace > ReportSummary5.height then
  begin
    if engine.freespace > ReportSummary5.height + child5.height then
    begin
      ntimes := int((engine.freespace-reportsummary5.height)/child5.height);
      for i := 1 to ntimes do
      begin
        engine.showband(Child5);
      end;
      engine.cury := engine.pageheight -reportsummary5.height - pagefooter6.height-1;
    end;
  end;
end;


procedure Memo41OnBeforePrint(Sender: TfrxComponent);
begin
  Memo41.Text :='';
  if <ADOQUERY1."PartNumber"><>''then
  Memo41.Lines.Add (<ADOQUERY1."PartNumber">);
  if <ADOQUERY1."CustomerPN"><>''then
  Memo41.Lines.Add ('CustomerPN: [ADOQUERY1."CustomerPN"]');
  if <ADOQUERY1."Description"><>''then
  Memo41.Lines.Add ('DESC: [ADOQUERY1."Description"]');
  if <ADOQUERY1."Condition"><>''then
  Memo41.Lines.Add ('CONDITION: [ADOQUERY1."Condition"]');
  if <ADOQUERY1."DateCode"><>''then
  Memo41.Lines.Add ('DATECODE: [ADOQUERY1."DateCode"]');
  if <ADOQUERY1."Package"><>''then
  Memo41.Lines.Add ('PACKAGE: [ADOQUERY1."Package"]');
  if <ADOQUERY1."LeadFree"><>''then
  Memo41.Lines.Add ('LEADFREE: [ADOQUERY1."LeadFree"]');
  if <ADOQUERY1."HarmonizedCode"><>''then
  Memo41.Lines.Add ('HarmonizedCode: [ADOQUERY1."HarmonizedCode"]');
  if <ADOQUERY1."Origin"><>''then
  Memo41.Lines.Add ('COO: [ADOQUERY1."Origin"]');


end;


needpascalhelp

  • New member
  • *
  • Posts: 5
Never mind.  I figured it out.

end;
begin
end.

Thanks for looking at it though in this forum. 

engkin

  • Hero Member
  • *****
  • Posts: 2513
FYI, this:
Code: Pascal  [Select]
  1.   if Checkbox_InvoiceC.checked = true  then
  2.        InvoiceC.visible := true
  3.   else
  4.        InvoiceC.Visible := False;

is equivalent to:
Code: Pascal  [Select]
  1.   InvoiceC.visible := Checkbox_InvoiceC.checked;

needpascalhelp

  • New member
  • *
  • Posts: 5
Is there a way to mark this as solved??

engkin

  • Hero Member
  • *****
  • Posts: 2513
Modify your first post and change the title by adding [SOLVED] to its beginning.

needpascalhelp

  • New member
  • *
  • Posts: 5
Re: [SOLVED]Using software that is no longer supported and tryi
« Reply #7 on: June 06, 2019, 12:23:42 am »
Thank you.