Lazarus

Free Pascal => Beginners => Topic started by: JLWest on March 03, 2021, 11:05:09 pm

Title: Help Needed(Closed)
Post by: JLWest on March 03, 2021, 11:05:09 pm
Need to find out if this runs or a UNIX and/Mack

Win 10 should work.

Unzip in one dir and edit the Config.txt to match where it was unziped (hopefully).

Thanks.

The help file isn't 100% correct.
Title: Re: Help Needed
Post by: MarkMLl on March 03, 2021, 11:16:54 pm
Please give us some indication of what it does and what resources it requires.

sudo rm -rf / is frowned upon :-)

MarkMLl
Title: Re: Help Needed
Post by: JLWest on March 03, 2021, 11:51:06 pm
It just needs the FreePascal directory mapped in Config.txt and the install directory mapped in Installation.txt

Both of these files are in yourinstalldirectory/files

The freepascal directory is the dataset.

If it runs clicjk on Dataset then sidebar select freepascal and click on the Set button.

From there just click on the freepascal items use help
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 04, 2021, 10:49:56 am
My specs:
OS: Ubuntu 20.10 64b Dark Theme
Lazarus/FPC: Trunk rev 64674

It doesn't work until:
Code: Pascal  [Select][+][-]
  1.  Procedure TForm1.VerifyInstallPath;
  2.   Var
  3.    Found : Boolean = False;
  4.    Path  : String;
  5.   begin
  6. {$IFDEF WINDOWS}
  7.    Path := INSTALLPATH + 'QuickList.exe';
  8. {$ELSE}
  9.    Path := INSTALLPATH + 'QuickList';
  10. {$ENDIF}
  11.    Found := FileExists( Path );
  12.    if ( Not Found ) then begin Halt; end;
  13.  end;
  14.  

And see attached screenshot.
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 04, 2021, 10:55:42 am
And if I cross-compile to i386-win32, see attached screenshot under wine.

PS: Is it supposed to be this disorganized?
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 04, 2021, 11:01:32 am
It also doesn't help when you LowerCase() all the file paths because Linux/*nix has a case sensitive file system.
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 04, 2021, 11:59:10 am
Hey there,

Could you please put this on GitHub of some other site where we can do Pull Requests to help you with your code?

It feels like it's very Windows centric and it will need a ton of cleanup if you want it to be cross-platform.

I can give some help with Linux, since that's what I code in, but I can't give you any help with macOS, sorry.

Cheers,
Gus
Title: Re: Help Needed
Post by: MarkMLl on March 04, 2021, 12:28:22 pm
Could you please put this on GitHub of some other site where we can do Pull Requests to help you with your code?

I'd suggest that for something of uncertain use that needs as much fettling as this does Dropbox would be more appropriate. It hardly shows our favourite development tools in a good light, and it would be unfortunate if somebody stumbled across it and assumed that it was the best this community had to offer.

MarkMLl
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 04, 2021, 01:11:00 pm
Hey Mark,

I'd suggest that for something of uncertain use that needs as much fettling as this does Dropbox would be more appropriate. It hardly shows our favourite development tools in a good light, and it would be unfortunate if somebody stumbled across it and assumed that it was the best this community had to offer.

Yes the code if god awful to look at and the UI screams of... well it just screams at you, doesn't it, but I'm not gonna deny help on those parameters.
I will, nonetheless, deny help if I have to work without any VCS support. And Dropbox is a very sh*tty VCS.

Cheers,
Gus
Title: Re: Help Needed
Post by: JLWest on March 04, 2021, 09:27:10 pm
@ gcarreno
Incorporated your VerifyInstallPath, Work great thanks.

This attached zip shows the 1. Opening form and 2. Normal operations form.
This is how it looks or Win 10

 
Title: Re: Help Needed
Post by: JLWest on March 04, 2021, 09:42:26 pm
It also doesn't help when you LowerCase() all the file paths because Linux/*nix has a case sensitive file system.

Linux has a case sensitive file system. If everything is lowercase why would that create a problem. I think I'm consistent. Everything on disk is lowercase. When I create or load files they are always lowercase. Display is whatever the user specifies for names.
Title: Re: Help Needed
Post by: JLWest on March 04, 2021, 10:23:14 pm
Hey Mark,

I'd suggest that for something of uncertain use that needs as much fettling as this does Dropbox would be more appropriate. It hardly shows our favourite development tools in a good light, and it would be unfortunate if somebody stumbled across it and assumed that it was the best this community had to offer.

Yes the code if god awful to look at and the UI screams of... well it just screams at you, doesn't it, but I'm not gonna deny help on those parameters.
I will, nonetheless, deny help if I have to work without any VCS support. And Dropbox is a very sh*tty VCS.

Cheers,
Gus

In defense of the UI design.

First you have to look at it as it should appear. A Screen shot was posted.
if you are looking up a Free Pascal item just click on the name "ContainsText".

It's displayed. What could be simpler?

It has a two level UI design. Items are either a main item or a sub item. Sub items have lower level items.

It also allows for unlimited items and will handle duplicate names. You can have an Insert under Listbox and one under String.

'Audit' will check the data items.'
'Delete' allow deletions of items, subitems,
'Edit' will allow you to edit any item.
'Save' is used in some operations and is displayed 'Red' when active.
'New' allows the creation of new main item.
'New Sub' allows the creation of new sub with a single sub item.
'New SI' allows the creation of a new Sub Item.
'Rename' allows the rename of a item or Sub
'Set' Activates the Selected DataSet. You can have unlimited, phone book, passwords ect.
'Index' displays every item on the system, its location on the system and the FPC use clause system.
'MM' is just the 'Main Menu' Items
'AllTags' Same as Index displayed in the LBWork listbox.
'To CVS' builds CVS files out of ALLTags
NEW DS creates a new DataSet - Phone Book
X DS Deletes a DataSet.

Upper right hand corner. 
 Click help after clicking any other button and it will display help. You can edit the help file as save by clicking the small 'f' icon next to the  help button.

No the UI isn't windows compliant. It meant for a quick lookup and easy access of information.

Now I don't have to use Google, SourceForge and Wiki for FreePascal Documentation.

Another advantage is finding information on a FPC function or procedure, like 'Pos'.
 
Click on 'Index' scrool to Pos. On this system its in strings but it in 'system' of FPC.

As for the bad code. 'No defense, no apologies'.

At this point I don't know what I'm going to do with this other that I use it every day for FPC reference.
 

Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 05, 2021, 10:15:03 am
Hey JL,

Linux has a case sensitive file system. If everything is lowercase why would that create a problem. I think I'm consistent. Everything on disk is lowercase. When I create or load files they are always lowercase. Display is whatever the user specifies for names.

You're only thinking about your code, your directory choices, that's a tad blind to the environment around you (not to mention user input), but that's for another talk, nevermind.

Specifically I decided to drop your code under /home/gcarreno/Downloads/QL, which means that I edited the files to have full paths and not relative paths.
So when you LowerCase() all your path strings, my /home/gcarreno/Downloads/QL is now /home/gcarreno/downloads/ql, and that for any case sensitive file system is 2 different paths. You do know what case sensitive means right?

On Windows /home/gcarreno/Downloads/QL and /home/gcarreno/downloads/ql are the same paths because NTFS is case insensitive.
On any Linux/*nix /home/gcarreno/Downloads/QL and /home/gcarreno/downloads/ql are different paths because most, if not all, the filesystems are case sensitive.

Do you now understand?

Cheers,
Gus
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 05, 2021, 10:34:13 am
Hi JL,

@ gcarreno
Incorporated your VerifyInstallPath, Work great thanks.

You're quite welcome!
After a while it hit me, why are you looking for yourself under the folder where the Operating System launched your app. It's like making sure that you see yourself in front of a mirror, or touching yourself to make sure you exist.
In any system, this will only fail if you're looking for the wrong thing, like you were, so it makes no sense.
You already have the Application.Location folder, which you use in VerifyInstallPath(), so why look for the executable?
Wouldn't make more sense to look for the files folder and to see if there are files there?
And you don't even do anything with the fact that you can't find yourself, you just exit, again, what?!?!?!?

This attached zip shows the 1. Opening form and 2. Normal operations form.
This is how it looks or Win 10

Sorry, but that UI is still quite awful. It looks like the version of a good UI but for a person with vision impairment. I have quite a high level of Myopia and Astigmatism, so I'm not being ableist, it's just that awful, sorry.
When you do a UI, it should be compliant with normal standards first and then you can have an Accessibility modifier, not the other way round.
And to be honest it really doesn't differ from the my Ubuntu version, apart from what's known about gtk skewing buttons, labels and edits sizes and fonts.

Cheers,
Gus
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 05, 2021, 11:07:29 am
Hi JL,

In defense of the UI design.

First you have to look at it as it should appear. A Screen shot was posted.

I've already commented on the UI looks on another reply.

if you are looking up a Free Pascal item just click on the name "ContainsText".

{Very long winded explanation of something that should be intuitive}

From what I've seen from looking at a bit of your code and now this long winded explanation, you're making the user do stuff that you could do in programming.
I don't think the notion of "programming to ease human life" as quite sunk into you.
Why does the user have to click on the button Dataset? This should be a check on FormCreate() or implemented via the very intuitive File->Load paradigm.
Why is information flow form right to left, when most of the standards make it left to right? Is this a eastern/asian focused application?
If you look at most standard UIs, you'll have a TListBox on the left with your options and then the info panel on the right, right?

And lastly, your UI should thrive to be intuitive, not the kind of UI that doesn't have Main Menus, Context SubMenus and has to be explained by 15+ paragraphs.

At this point I don't know what I'm going to do with this other that I use it every day for FPC reference.

The point I'm trying to make is: If this is a tool YOU use and YOU are comfortable with, keep at it and that's all right. It's your baby, you love it no matter what other's say.
BUT If you're gonna release it into the wild, then you have to take criticism like all the rest of us.
Conventions were invented to normalise our day to day usage of things, that's why Microsoft invests million in studies about UIs.
Then we all, in the wild, read them, understand them and IMPLEMENT them, because we want to be kind to our users.
But we also want to be kind to our fellow programmers because we want our babies to be maintained after we die, or leave a company, so we also have nice looking and READABLE code.

All that I've criticised about your UI and code should not be taken as a personal attack, just a though love approach to make you consider getting out of your blinders and pay attention to the world around you.

MarkMLI was right when he said that your app is not the best this community has to offer. He said that because of your complete disregard of the standards that have been agreed and fought over the years by more intelligent and kinder programmers that came before us.

So in conclusion, if you want this little utility app to be accepted, first you'll have to comply with standards and then explain, to all of us, why your thing is better than the self-updating resources that we have now?

Cheers,
Gus
Title: Re: Help Needed
Post by: JLWest on March 05, 2021, 10:22:46 pm
My basic question was answered. It doesn't run well or not at all on Unix. I can live with that. Answer is simple, Windows Only.

As for the UI. Not willing to change. You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to. And once you reach that age there isn't a lot anyone can do about that. Hopefull you'll learn that. It's a good thing.

And by the way. The reason you have to click on 'DataSet' and select one from the listbox is because you can have more that one. I have FreePascal, Phonebook,
House, Passwords, Appliance Warranty, Autos and Toyhauler. It's easy to copy all this stuff to a thumbdrive for backup.

Thanks for the Help


Title: Re: Help Needed
Post by: dsiders on March 05, 2021, 10:35:38 pm
Not willing to change. You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to.

Like writing a decent subject line for your posts? That was obvious 999 messages ago.
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 05, 2021, 11:43:31 pm
Hey JL,

You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to.

I'm at 51 an I'm fighting with every fibre of my being to NEVER turn into the grumpy old fart that you portray. Being old doesn't excuse being rude or a troll.
I didn't say you were obligated to adhere, I said it would be nice of you to try and show some empathy towards your fellow human beings.

You know, it's because of people like you that the world is in the covid-19 crisis that it is. Your selfish, obstinate and utterly in the wrong, but you'll never admit that you're wrong because you're just an ugly person inside.

I'm now really sorry that I ever extended any sympathy towards you. I'm even gonna delete that sorry excuse of a program so i don't get the cuties from you!!

Have a good life!

No Cheers,
Gus
Title: Re: Help Needed
Post by: VTwin on March 06, 2021, 02:53:11 am
As for the UI. Not willing to change. You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to.

So why ask for help if you have it all figured out?
Title: Re: Help Needed
Post by: JLWest on March 06, 2021, 03:08:34 am
As for the UI. Not willing to change. You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to.

So why ask for help if you have it all figured out?

I would have thought that was obvious in the first post. "Will this run on Unix". The answer was no.

Title: Re: Help Needed
Post by: JLWest on March 06, 2021, 03:20:18 am
This was posted in "Beginners".

The program isn't meant for programmers who know it all. You don't have to look up anything.

But, as a beginner is is very difficult to know what you don't know. First off you don't know what to search for or where to look.

And the Old Line "Read the Manual!' Sucks. Few read the manual while trying to learn a language. I just got tired of typing in the google search box "Free Pascal String Function".


For me, and maybe it's just me the documentation for PFC is nothing to brag about. But here again it probably doesn't really matter that much. Usage of FreePascal isn't growing by leaps and bound.
Title: Re: Help Needed
Post by: Fred vS on March 06, 2021, 05:33:01 pm
As for the UI. Not willing to change. You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to.

So why ask for help if you have it all figured out?

I would have thought that was obvious in the first post. "Will this run on Unix". The answer was no.

Huh, sorry to interfere here but I dont understand why your code (with some modifs) should not work on Unix.

Maybe the first thing to do is remove {$IFDEF UseCThreads} (for me strange that Lazarus gives it by default):

Code: Pascal  [Select][+][-]
  1. program QuickList;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses
  6.   {$IFDEF UNIX} // no other conditions.
  7.   cthreads,
  8.   {$ENDIF}

And some tuning in the config path then your code should perfectly run under Unix.

(And dont forget the undoubtedly true mirror-theory: a person that describes a other person, describes in fact himself).

Fre;D
Title: Re: Help Needed
Post by: JLWest on March 06, 2021, 06:50:41 pm
@ Fred vS

Your not interfering. Thanks for the help. I'll try it. But I don't have any way to test the results.

Yea, I was beginning to think there was a new standard on the "Beginners board". In the course of not providing help you get to call the person names.

I do fail to see how that will promote FreePascal. May they could change the name of the Beginners Board to "Personal Insults". 
Title: Re: Help Needed
Post by: Fred vS on March 06, 2021, 07:11:59 pm
@ Fred vS

Your not interfering. Thanks for the help. I'll try it. But I don't have any way to test the results.

Yea, I was beginning to think there was a new standard on the "Beginners board". In the course of not providing help you get to call the person names.

I do fail to see how that will promote FreePascal. May they could change the name of the Beginners Board to "Personal Insults".

Hello JLWest.

Sorry to repeat myself:
Quote
(And dont forget the undoubtedly true mirror-theory: a person that describes a other person, describes in fact himself).

Now about your project, only changing, like gcarreno-when-he-is-great explained:

Code: Pascal  [Select][+][-]
  1. Procedure TForm1.VerifyInstallPath;
  2.   Var
  3.    Found : Boolean = False;
  4.    Path  : String;
  5.   begin
  6. {$IFDEF WINDOWS}
  7.    Path := INSTALLPATH + 'QuickList.exe';
  8. {$ELSE}
  9.    Path := INSTALLPATH + 'QuickList';
  10. {$ENDIF}
  11.    Found := FileExists( Path );
  12.    if ( Not Found ) then begin Halt; end;
  13.  end;

And it works here on Linux 64 bit.

But, about the GUI appearance, maybe you should think to make the form sizable because here on a 1024x800 it is not readable.

Fre;D


 
Title: Re: Help Needed
Post by: VTwin on March 06, 2021, 07:51:50 pm
As for the UI. Not willing to change. You state I have to adhere. "No I don't". At 79 years old I don't have to do one thing I don't want to.

So why ask for help if you have it all figured out?

I would have thought that was obvious in the first post. "Will this run on Unix". The answer was no.

Sorry, I misunderstood.
Title: Re: Help Needed
Post by: JLWest on March 06, 2021, 09:07:37 pm
@ Fred vS

Not sure I understand all the ins and outs of resizing.
I guess I could create a trunk and if it work OK and if not delete the trunk.

Thanks.



Title: Re: Help Needed
Post by: Fred vS on March 06, 2021, 10:11:24 pm
@ Fred vS

Not sure I understand all the ins and outs of resizing.

Here, compiled with fpc 3.2.0 and LCL GTK2 widget-set, the main form is not sizable, you may only move it but nor re-size it.
(Note that I dont know well LCL widget-set and did not check the gui code, did you set the main-form as sizable?)

Fre;D
Title: Re: Help Needed
Post by: Fred vS on March 06, 2021, 10:33:55 pm
@ Fred vS

Not sure I understand all the ins and outs of resizing.

Here, compiled with fpc 3.2.0 and LCL GTK2 widget-set, the main form is not sizable, you may only move it but nor re-size it.
(Note that I dont know well LCL widget-set and did not check the gui code, did you set the main-form as sizable?)

Re-hello.

I think that the main form is not sizable because you added TSizeConstraints.
If you remove it (set all min-max to 0) , the form will be re-sizable.
Also you may set 'AutoScroll := true".

Title: Re: Help Needed
Post by: JLWest on March 06, 2021, 11:03:06 pm
Yes you are right. I set the main form constraints. I'll make the changes and post, probably tomorrow,
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 07, 2021, 12:01:12 am
Hi all,

I think I blabbered way too much without putting some effort on the demonstration part.

And no, I'm not backing up on telling a 79 year old that he is rude and obstinate.

So I had some time to spare and here's version v0.1 of QLProper and some screen shot under Ubuntu and Wine, since I don't have a Windows machine.

At this point it does:

Next post will be level 2 data retrieval.
And since this is supposed to be hierarchical, in a near future I'll port the app to use TVirtualStringTree
I'm not sure If I'll go all the way into the editing/creating of either datasets and/or levels of data in the datasets.

This was with a very superficial look at the JL's code. At the moment I understand mm.txt, a bit about the doublex folder and the hierarchy of the content folder (I think. It's all very confusing).
I still don't understand:

Let the comments and replies bathe me with your opinions...

Cheers,
Gus
Title: Re: Help Needed
Post by: dbannon on March 07, 2021, 12:17:20 am
JL, a bit of philosophy. Take it or leave it.

I consider myself a moderately capable programmer, most certainly not advanced or 'skilled' but enough to do what I want to do. I have got there by dogged hard work, pretty much the same as you. And you can do that with programming, we do it a lot slower than a pro, we spend  lot of time looking things up, looking at other people's code and just looking at our code wondering ...

But the truth is that approach does not work for a UI.  You cannot just keep working at it, trusting you will eventually get it right. In fact, UI design is a totally different skill set. Don't assume you can create a good UI just because you can write code,

With my project, I have had a lot of help from (non-programmer) people who have a much greater feel for UI than I can ever have. After a initial "kek ?" I have welcomed their input and acted on it. Graciously.

As a model, it works. Please consider.

Davo
Title: Re: Help Needed
Post by: JLWest on March 07, 2021, 02:46:45 am
Well it's confusing yo me also.

But here is how I look at it.

I realize it needs a lot of change to the code to really be good code. But, having said that consider the intended user. Beginners, so I wanted code that a novice could understand. 

Alltag.txt is created every time the program is started. It contains all the Tags on the system with a Tag/sbdirectory or Tag/doublex . A Tag/doublex denotes a sub menu where a Tag/content is a top level tag item.

Click on ACtiveControl and you get the syntax for ActiveControl. Click on Arrays and you get function related to arrays. Click the SUB button and you go back to the top level menu.

When a Tag is selected a red X is suppose to appear to the left of the Tag but it's broke.


MM.txt is a static file and is the top level of the display tags. It changes when you add a Sub, new tag to the top level rename deletes.

I'll download and test QLProper.
Thank you
Title: Re: Help Needed
Post by: JLWest on March 07, 2021, 03:46:26 am
I downloaded and looked a QLProper.

After considering all option at this point I think I will abandon the project. I'll use it privately. For me it works great. For others not so much I guess.

Thanks for all the comments and help.
Title: Re: Help Needed
Post by: Gustavo 'Gus' Carreno on March 07, 2021, 03:50:11 am
I realize it needs a lot of change to the code to really be good code. But, having said that consider the intended user. Beginners, so I wanted code that a novice could understand. 

I'm really sorry about what I'm gonna tell you next, but I think you need to read it and hopefully incorporate it into your coding context.

After reading your code and looking at your UI decisions, the only thing that comes to mind is that your skills got suspended in time from when terminals with 80 columns by 40 rows of text was the default UI.
You make UI decisions with complete disregard to the most basic functionalities of a TButton like it was just a rectangle in the screen that you click and nothing else.
You add functionality to TLabel, that was never intended, or discussed, in any meeting about User eXperience(UX) on any Graphical User Interface(GUI).
You make convoluted chained calls, 3 to 4 levels deep, to functions/procedures with very cryptic names.
Nowadays, for the sake of readability, every function/procedure has a long descriptive name so Beginners/Novices can read the code with ease.

Alltag.txt is created every time the program is started. It contains all the Tags on the system with a Tag/sbdirectory or Tag/doublex . A Tag/doublex denotes a sub menu where a Tag/content is a top level tag item.

This explanation does not make sense with the evidence I'm finding on the files. But I need to dive deeper in your rats nest of chained functions/procedures.

Click on ACtiveControl and you get the syntax for ActiveControl. Click on Arrays and you get function related to arrays. Click the SUB button and you go back to the top level menu.

I got that already, and to get at it I had to chase down every function/procedure where you LowerCase() paths, because it was messing all the file reads!!
You can see on QLProper that I load level 1 info correctly.

When a Tag is selected a red X is suppose to appear to the left of the Tag but it's broke.

I noticed some inconsistencies on this, but the fact that the UI never informs you about it's state, doesn't help at all.

MM.txt is a static file and is the top level of the display tags. It changes when you add a Sub, new tag to the top level rename deletes.

This is implemented like it should on QLProper on level 1 data. Need to get to level 2 data next.

I'll download and test QLProper.

Good. Have a good look and tell me if it isn't easier to use.


In summary what you're doing is nothing more than a note taking app with 2 level of hierarchy based on text files and folders for the database.
It's nothing new and it's been implemented in so many ways that you can find a gazillion examples on the web.
You spent all this time and you don't even have a basic search function.
You have no data structure what so ever apart from the data residing inside TListBoxes.
You clear those TListBoxes frequently, so your data is quite volatile.

All these little faults are ironed out by any, most basic, tutorial or online course for programming.
Any online tutorial/course hammers the fact that you code against robust data structures. Or a database.
Every online tutorial/course is now heavily based on solid Object Oriented Programming(OOP).
Your code has none of that and on top of it, it is very hard to follow.
It's so dense that even a moderately knowledgeable programmer gets lost, so a beginner would completely drown.
Your insitance that it as to me "my way" is just a projection of your fear towards innovation.
You don't want to learn. Because for you to begin to learn, you would have to admit that what you know is dated and obsolete.
That would mean that you would have to invest a ton of time doing something that was hard the first time around, when you were young, and now is triple hard that you're old.
So you pull the age card and hope that no one notices that you're just a stubborn dinosaur.

I really advise you to Google "Note taking app with source code", or to search for something like that on GitHub.
It will make you some good to look at UI choices made by others so you can freshen up your GUI skills. They are quite lacking, I'm afraid.

Cheers,
Gus
TinyPortal © 2005-2018