Recent

Author Topic: can any one help me in my little programe here :/ pls guys  (Read 15840 times)

minesadorada

  • Sr. Member
  • ****
  • Posts: 453
  • Retired
Re: can any one help me in my little programe here :/ pls guys
« Reply #15 on: May 01, 2017, 01:27:56 pm »
Here's 2 minute's work with F2 and JEDI:
It compiles. (I added a ReadLn at the end to see if the code produced anything)

Code: Pascal  [Select][+][-]
  1. program best;
  2.  
  3. uses
  4.   wincrt;
  5.  
  6. type
  7.   Ttabarray = array [1..20] of string;
  8. var
  9.   TabArray: Ttabarray;
  10.  
  11.   procedure navbar(var TabArray: Ttabarray);
  12.   var
  13.     iListEnd, iCount, iTotal: integer;
  14.     sStartUL, sEndUL, sNavbarName, sPageName: string;
  15.   begin
  16.     sStartUL := '<ul>';
  17.     sEndUL := '</ul>';
  18.     writeln('combient de navBar tu veux?');
  19.     readln(iTotal);
  20.     for iCount := 1 to iTotal do
  21.     begin
  22.       insert('<li><a href=""></a></li>', TabArray[13], length(TabArray[13]) + 1);
  23.       writeln('donner le nom pour ton navBar exemple (Home,about,news):');
  24.       readln(sNavbarName);
  25.       iListEnd := pos('</li>', TabArray[13]) - 4;
  26.       insert(sNavbarName, TabArray[13], iListEnd);
  27.       writeln('donner le nom de page a transfert(extension[html])');
  28.       readln(sPageName);
  29.       insert(sPageName, TabArray[13], pos('href=""', TabArray[13]) + 6);
  30.     end;
  31.     TabArray[13] := sStartUL + TabArray[13] + sEndUL;
  32.   end;
  33.  
  34. begin
  35.   navbar(TabArray);
  36.   Write(TabArray[13]);
  37.   ReadLn;
  38. end.                  
« Last Edit: May 01, 2017, 05:45:36 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

lainz

  • Hero Member
  • *****
  • Posts: 4740
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: can any one help me in my little programe here :/ pls guys
« Reply #16 on: May 01, 2017, 03:06:35 pm »
Hi white hat. You sent me a PM to see if I can help you.
I think he has PM'ed everyone who has answered to any of his threads in the last month. That alone should be worth a warning.
I am getting PMs, too. I replied and told that this public forum is the right place for such generic help requests.
A personal message is a right channel for personal issues.
I personally learned that lesson some time ago when I was a newbie, I also sent PM to some users asking for help, but they give the reason to better post in the forum. So  if he learn the lesson will be fine.

jmm72

  • Jr. Member
  • **
  • Posts: 79
  • Very experienced in being a beginner...
Re: can any one help me in my little programe here :/ pls guys
« Reply #17 on: May 01, 2017, 04:46:50 pm »
I personally learned that lesson some time ago when I was a newbie, I also sent PM to some users asking for help, but they give the reason to better post in the forum. So  if he learn the lesson will be fine.

The last time before this one he asked me a question though PM, I told him to post it in the forums, so 1. someone else other than me can answer, and 2. others who read it can learn something from the exchange. He has simply ignored. And I bet I am not the only one who has answered to him like that.

I'm not up to banning him or anything. It just annoys me so much. I come from another unrelated help forum where it was explicitly forbidden to ask questions by PM (unless they were personal). Someone posted 1 problem, someone else answered, and suddenly to thank the answerer, he got 1 PM with something along the lines of "thank you for helping me with XXX you're amazing now you might help me with these 17 other problems I have"... We were volunteers, not private coaches.
Lazarus 1.6.4 + FPC 3.0.2 64bits under Windows 7 64bits
Only as a hobby nowadays
Current proyect release: TBA

Bart

  • Hero Member
  • *****
  • Posts: 5667
    • Bart en Mariska's Webstek
Re: can any one help me in my little programe here :/ pls guys
« Reply #18 on: May 01, 2017, 06:37:24 pm »
Code: Pascal  [Select][+][-]
  1. program best;
  2.   procedure navbar(var TabArray: Ttabarray);
  3.   var
  4.     iListEnd, iCount, iTotal: integer;
  5.     sStartUL, sEndUL, sNavbarName, sPageName: string;
  6.   begin
  7.     sStartUL := '<ul>';
  8.     sEndUL := '</ul>';
  9.  

You should of course define sStartUL and sEndUL as constants not as variables.

Second: IMO you should ask the questions and get the answers first, and only then start "building" the hyperlink text from that.

(I added a ReadLn at the end to see if the code produced anything)

And the output is wrong, as TS pointed out already.
Reasons have been given here.

Bart

RAW

  • Hero Member
  • *****
  • Posts: 871
Re: can any one help me in my little programe here :/ pls guys
« Reply #19 on: May 01, 2017, 08:51:21 pm »
This is a GUI - Glimpse:

1. Download LAZARUS and install it
2. Unpack NavBar GUI.7z
3. Start LAZARUS and Load Project (CTRL+F11)
4. Press F9 and wait a moment

Much easier to edit things....

minesadorada

  • Sr. Member
  • ****
  • Posts: 453
  • Retired
Re: can any one help me in my little programe here :/ pls guys
« Reply #20 on: May 01, 2017, 09:20:52 pm »
You should of course define sStartUL and sEndUL as constants not as variables.

Second: IMO you should ask the questions and get the answers first, and only then start "building" the hyperlink text from that.

(I added a ReadLn at the end to see if the code produced anything)

And the output is wrong, as TS pointed out already.
Reasons have been given here.

Bart

Hi Bart,
You may have skimmed the thread. I posted in response to Reply# 1 to show the OP how to present pascal code for consideration. I didn't change the OP's code.
No worries - I expect you have an automatic reaction to less than optimal code by now. I know how you feel!

I agree with @Handoko: And badly formatted pascal code makes me itch
« Last Edit: May 01, 2017, 09:25:45 pm by minesadorada »
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: can any one help me in my little programe here :/ pls guys
« Reply #21 on: May 01, 2017, 09:27:21 pm »
@minesadorada
I do hope you realize that you are encouraging TS to keep up his/her rude and obnoxious behaviour (even though your 'efforts' won't help TS a bit).

Where is the Guillotine smiley when one needs it  >:D

RAW

  • Hero Member
  • *****
  • Posts: 871
Re: can any one help me in my little programe here :/ pls guys
« Reply #22 on: May 02, 2017, 12:35:49 am »
If molly gets her >>Guillotine smiley<< then I want my RAMBO and TERMINATOR-Smiley.... just to let you know...  :P

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: can any one help me in my little programe here :/ pls guys
« Reply #23 on: May 02, 2017, 03:29:01 pm »
lol

It does bring up another question though. Where did the wink smiley hide ? It has been gone for ages now. Removed due to over-abuse ?

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: can any one help me in my little programe here :/ pls guys
« Reply #24 on: May 02, 2017, 03:42:30 pm »
lol

It does bring up another question though. Where did the wink smiley hide ? It has been gone for ages now. Removed due to over-abuse ?
really? din't noticed that  ;) ;) ;) ;) ;) ;)
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

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: can any one help me in my little programe here :/ pls guys
« Reply #25 on: May 02, 2017, 03:51:06 pm »
Well, for me it only displays:
Code: [Select]
;)Fitted into an otherwise empty bevel. e.g. the actual image is missing.

...and aaargh  >:D you got me  :D
« Last Edit: May 02, 2017, 03:56:41 pm by molly »

minesadorada

  • Sr. Member
  • ****
  • Posts: 453
  • Retired
Re: can any one help me in my little programe here :/ pls guys
« Reply #26 on: May 02, 2017, 07:07:52 pm »
@minesadorada
I do hope you realize that you are encouraging TS to keep up his/her rude and obnoxious behaviour (even though your 'efforts' won't help TS a bit).

Where is the Guillotine smiley when one needs it  >:D
I see your point of view: punish transgressors.
My point of view is that in order to teach, the best method is a good example.

The world is big enough for both points of view.

The PM issue is a non-issue for me: I ignore PMs from non-trusted sources.

And I've got too old to get annoyed by the small stuff. :(
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: can any one help me in my little programe here :/ pls guys
« Reply #27 on: May 02, 2017, 07:32:59 pm »
@minesadorada
I do hope you realize that you are encouraging TS to keep up his/her rude and obnoxious behaviour (even though your 'efforts' won't help TS a bit).

Where is the Guillotine smiley when one needs it  >:D
I see your point of view: punish transgressors.
My point of view is that in order to teach, the best method is a good example.

The world is big enough for both points of view.

The PM issue is a non-issue for me: I ignore PMs from non-trusted sources.

And I've got too old to get annoyed by the small stuff. :(

+1

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: can any one help me in my little programe here :/ pls guys
« Reply #28 on: May 02, 2017, 07:38:04 pm »
@minesadorada/valdir.marcos
I had a similar discussion with someone else on this board a while ago.

If you take the time to invest in TS's posts then you are able to see for yourself that showing code (as in "learning by example") does not help TS one bit.

Instead of TS attempting to learn something from given advise and/or code, TS is more willing to spend time bothering people until TS got an answer that can be used directly in his/her code.

It is like a whining child that can't have its way. The only thing you do with your actions is spoiling the brat even further.

But just as previous discussion in which the other person disagreed with me: you seem to have all the time in the world to be a personal assistant for TS and guide him/her throughout his/her programming life (that is, if you can call that programming)/

That you ignore personal messages from untrusted source is not a point. Point is that other people get bothered by it, because you encourage TS to keep on doing what he/she is doing as it seems profitable for TS.

The fact alone that someone tries to get an answer using PM's is showing a very egotistical mindset which does not belong to an open source project. As a matter of fact it doesn't belong everywhere in this world (but that is a pure personal view).

It is clear that either you don't give a darn or missed the fact that TS does not want to learn anything at all, rather only have an direct solution for his/her faulty code. TS can't even be bothered by making a proper topic, instead makes whining topics like "please help" "i need help", "can someone help me" etc. Which is also a clear indication TS has no clue (or does not want to know) what he/she is actually doing.

You can have a different view on that, of course (we live in a free world after all). But, ignoring the consequences and leave that for others to handle is imho just as egotistical.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: can any one help me in my little programe here :/ pls guys
« Reply #29 on: May 02, 2017, 08:36:01 pm »
Handoko no you don't undrestand we just take a 5 hours in the week to learn how to program with pascal and 21 hours of Back-end, functionality/scripting javascript and python that's i'm newbiethis is why i'm newbie there's no time but when i stay at home after school i learn it believe me i need your help for more progress i can make the mistake 2 time or 3 time but there's a time i will not make the same mistake 2 time

like the last time you when i get some mistake in my code t[11]:=fo1+t[10]+fo2; and you fix it to me i learn for you that you can see it in this code

@minesadorada/valdir.marcos
I had a similar discussion with someone else on this board a while ago.

If you take the time to invest in TS's posts then you are able to see for yourself that showing code (as in "learning by example") does not help TS one bit.

Instead of TS attempting to learn something from given advise and/or code, TS is more willing to spend time bothering people until TS got an answer that can be used directly in his/her code.

It is like a whining child that can't have its way. The only thing you do with your actions is spoiling the brat even further.

But just as previous discussion in which the other person disagreed with me: you seem to have all the time in the world to be a personal assistant for TS and guide him/her throughout his/her programming life (that is, if you can call that programming)/

That you ignore personal messages from untrusted source is not a point. Point is that other people get bothered by it, because you encourage TS to keep on doing what he/she is doing as it seems profitable for TS.

The fact alone that someone tries to get an answer using PM's is showing a very egotistical mindset which does not belong to an open source project. As a matter of fact it doesn't belong everywhere in this world (but that is a pure personal view).

It is clear that either you don't give a darn or missed the fact that TS does not want to learn anything at all, rather only have an direct solution for his/her faulty code. TS can't even be bothered by making a proper topic, instead makes whining topics like "please help" "i need help", "can someone help me" etc. Which is also a clear indication TS has no clue (or does not want to know) what he/she is actually doing.

You can have a different view on that, of course (we live in a free world after all). But, ignoring the consequences and leave that for others to handle is imho just as egotistical.

@molly
I respect your opinion. It's a valid one and necessary many times.

As a former teacher and professor, whitehat seems to me as a lost 14 or 15 year old boy or girl miss guided by a lazy or negligent or not well prepared teacher.

That teacher might even have his/her own problems such small salary, poor studying background, too much classes or students, over working, etc.
Whitehat seems to be a teenager trying to express him/herself in a foreign language in searching for knowledge that he/she can't find on his/her teacher or colleagues in high school.

Treating a boy/girl as a professional adult does not help.
As time goes by, he/she will learn how to really program and how to be a good professional.

We can never know what really happens in others' people lives.
When I can, I try to help. Simply as that.

I have been correcting other people's programming code since I was a 17yo student in technical high school guided by an excellent well paid teacher in an excellent free technical high school.
Since then, I have corrected students' and young programmers' code all my life.
When is possible, I just explain how to solve and ask for more searching; and when it is not, I show some small code examples or tips or links. I have even done pair programming many times.
I try to help as far as I can, but, as you, I do not do anybody else's duties.

Just as an extra information, I have not studied Computer Science (50% mathematics, 50% IT), I have graduated, post-graduated and done MBA in Systems Information (50% administration, 50% IT). That's why my programming abilities go more to business and database programming than to core programming.

 

TinyPortal © 2005-2018