Recent

Author Topic: Help posting a problem  (Read 3672 times)

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Help posting a problem
« on: January 25, 2018, 11:01:21 pm »
Can't figure out how to put code into a scroll box and post? I've looked everywhere?
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

jamie

  • Hero Member
  • *****
  • Posts: 6130
Re: Help posting a problem
« Reply #1 on: January 25, 2018, 11:13:08 pm »
Click the little "#" sign above the edit window.
 You will see this without the double quotes. "
Code: Pascal  [Select][+][-]
  1.    
"

 have your text on the clipboard and place your cursor the bracketed Code=Pascal
and bracketed /Code. Then do the right click and pasted it there between those two
bracketed statements.

 As you type along like I am now, you won't see the scrolling numbers on the left, only after the post has been
submitted and you then read it later is when you'll see it but all text you want to show as source code format
you must paste between those two bracketed statements.

 How that helps.


Sorry, it looks like this editor isn't going to actually show you what it looks like.
when you use the pound char, you'll get a left bracket, code = paste, right bracket and then paste
your code just after the first right bracket.
  you'll see another left bracket with ending forward slash,. your code goes between the two sets of
bracketed statements
« Last Edit: January 25, 2018, 11:16:44 pm by jamie »
The only true wisdom is knowing you know nothing

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Help posting a problem
« Reply #2 on: January 25, 2018, 11:25:15 pm »
Or you can type
[ code=pascal ] < your code goes here > [ /code ]
as literals, but omitting the spaces between "[" and "]", which I've inserted in order to stop the forum software interpreting what I'm writing as Pascal code when it isn't.
There is a Preview button beside the Post button which you can use to check what your post will look like, so you can correct it if need be before posting.

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Help posting a problem
« Reply #3 on: January 25, 2018, 11:56:37 pm »
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms,
  9.   IniFiles, Controls, Graphics, Dialogs, StdCtrls;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Button1: TButton;
  17.     Edit1: TEdit;
  18.     Label1: TLabel;
  19.     procedure Button1Click(Sender: TObject);
  20.     procedure FormCreate(Sender: TObject);
  21.     function iniRead(s : string): string;
  22.   private
  23.  
  24.   public
  25.  
  26.   end;
  27.  
  28. const
  29.   C_DB_SECTION = 'DB-INFO';
  30.  
  31. var
  32.   Form1: TForm1;
  33.  
  34.   INI          : TINIFile;
  35.   Author       : string;
  36.   MaxAttempts  : integer;
  37.   PassEnter    : string;
  38.   TryCount     : integer;
  39.   iniPath      : string;
  40.  
  41.  
  42. implementation
  43.  
  44. {$R *.lfm}
  45.  
  46. { TForm1 }
  47.  
  48. procedure TForm1.Button1Click(Sender: TObject);
  49. begin
  50.   Close;
  51. end;
  52.  
  53. procedure TForm1.FormCreate(Sender: TObject);
  54. Var
  55.   [color=red] callResult  : String;[/color]
  56. begin
  57.   iniPath    := Application.Location;
  58.  [color=red] callResult := iniRead(iniPath);[/color]
  59.   Edit1.Text := iniPath;
  60. end;
  61.  
  62. procedure Readini(s : String);
  63. Begin
  64.  
  65. end;
  66.  
  67. function TForm1.iniRead(s : string): string;
  68. var
  69.   str: string;
  70. begin
  71.   INI    := TINIFile.Create(iniPath);
  72.   str    := 'Process Worked';
  73.   Result := str;
  74.  
  75. end;
  76.  
  77. end.
  78.  


callResult declared at line 54 as a string and used at line 58 in the call to
 iniRead
I don't understand why it thinks Parameter "s" not used


//Compile Project, Target: project1.exe: Success, Hints: 3
//unit1.pas(55,4) Note: Local variable "callResult" is assigned but never used
//unit1.pas(62,19) Hint: Parameter "s" not used
//unit1.pas(21,22) Hint: Parameter "s" not used
« Last Edit: January 26, 2018, 12:15:36 am by JLWest »
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Help posting a problem
« Reply #4 on: January 26, 2018, 12:10:22 am »
Code: [Select]
1) you have to close the code block with [ /code ] otherwise it is done automatically for you at the end of the message.
2) the colouring/highlighting is automatic your colour selection will not be seen inside the code tags.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

JLWest

  • Hero Member
  • *****
  • Posts: 1293
Re: Help posting a problem
« Reply #5 on: January 26, 2018, 12:16:55 am »
Ok thankls.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Help posting a problem
« Reply #6 on: January 26, 2018, 10:25:18 am »
Sorry, it looks like this editor isn't going to actually show you what it looks like.

And using [nobbc]text[/nobbc] will disable any bulletin-board-code conversion so you can show the real code  :D

So:
[code=pascal]<your code goes here>[/code]

(you can press quoted-reply to see what I did there)

nummer8

  • Full Member
  • ***
  • Posts: 111
Re: Help posting a problem
« Reply #7 on: January 26, 2018, 11:05:59 am »
Code: Pascal  [Select][+][-]
  1. function TForm1.iniRead(s : string): string;
  2. var
  3.   str: string;
  4. begin
  5.   INI    := TINIFile.Create(iniPath);
  6.   str    := 'Process Worked';
  7.   Result := str;
  8. end;
  9.  

In this function s is only mentined in the function call, not in the function itself.
I think you try to say

Code: Pascal  [Select][+][-]
  1. function TForm1.iniRead(s : string): string;
  2. var
  3.   str: string;
  4. begin
  5.   INI    := TINIFile.Create(s); // <==
  6.  //change code below to retrieve the right values from the ini file
  7.   str    := 'Process Worked';
  8.   Result := str;
  9. end;
  10.  

For more info in ini files.
https://www.freepascal.org/docs-html/fcl/inifiles/tinifile.html

Jos

 

TinyPortal © 2005-2018