Problems with Create LOCALs

30 views
Skip to first unread message

Lutz Scheffler

unread,
Jun 5, 2020, 3:18:27 AM6/5/20
to Thor, the Tool Manager for FoxPro
While it works like a charm, I found a problem

This works
lnLoop1   = 0
lnColumns
= 4
lcTable  
= "BlaBlub"
and this
LOCAL lnLoop1, lnColumns, lcTable

lnLoop1  
= 0
lnColumns
= 4
lcTable  
= "BlaBlub"
and this
LOCAL lnLoop1,;
 lnColumns
,;
 lcTable

lnLoop1  
= 0
lnColumns
= 4
lcTable  
= "BlaBlub"
and this
LOCAL ;
 lnLoop1
,;
 lnColumns
,;
 lcTable

lnLoop1  
= 0
lnColumns
= 4
lcTable  
= "BlaBlub"
this fails
LOCAL;
 lnLoop1
,;
 lnColumns
,;
 lcTable

lnLoop1  
= 0
lnColumns
= 4
lcTable  
= "BlaBlub"

and creates a new local declaration on top of all. Guess what my prefered notation is? :)

This is true for all other forms declaring a var.

A look into the code reveals, that GetSourceCodeLine just concenat the lines without removing the ";" while FindCurrentLocals just
lcWord1 = Lower (Getwordnum (lcSourceLine, 1))
That will keep the semicolon in lcWord1.

I see this behaviour on other methods as well. IOW the KEYWORD; case is nowhere covered.

I understand, it is not as easy as to just replace the semicolon with a space in GetSourceCodeLine.

Should I try to fork and solve the problem myself?

Lutz Scheffler

unread,
Jun 5, 2020, 3:35:06 AM6/5/20
to Thor, the Tool Manager for FoxPro
Update:

Even GetSourceCodeLine fails. try
 text;
to lcx
 bla
ENDTEXT
?lcx


#if;
.f. THEN
 
?bla
#ENDIF &&

This all is valid (while not nice formated) code

Eric Selje

unread,
Jun 5, 2020, 11:57:29 AM6/5/20
to FoxPr...@googlegroups.com
I'd recommend fixing it and doing a pull request. We need more people to get involved like this.

Eric

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FoxProThor/4619cbee-b8ac-461a-8b55-26e435307de1o%40googlegroups.com.

Jim Nelson

unread,
Jun 5, 2020, 12:01:36 PM6/5/20
to FoxPr...@googlegroups.com
It's really great to still see development and interest in this after all these years.



--
Jim Nelson

(805) 498-9195 (preferred)
(720) 837-3536 (cell)

Matt Slay

unread,
Jun 5, 2020, 12:12:37 PM6/5/20
to Eric Selje, FoxPr...@googlegroups.com

Note - While this seems like a Thor or Thor Repository issue, the code that he's pointing to actually is from the Beautify class in "PEME_Beautify.vcx" from the PEM Editor tool on VFPx / GitHub.  Thor simply invokes the PEM Beautify tool, but the PEME Beautify tool and code is not part of Thor or Thor Repository.

So, the Fork/Fix/Pull-Request will have to be done on the PEM Editor repository, then whoever is maintaining the PEM Editor project will have to update the download endpoint for PEM Editor so Thor Check For Updates will see the new version.

PEM Editor source on GitHub: https://github.com/VFPX/PEMEditor

To view this discussion on the web visit https://groups.google.com/d/msgid/FoxProThor/CAAwxvUm8b30z6D1LTp2PKiR-wK36G5Gk%3D8e1-rGKnmsr2rvtfA%40mail.gmail.com.
--
Matt Slay, President
Jordan Machine Co.
355 Clow Lane
PO Box 170339
Birmingham, AL 35217
Ph: 205-849-5050
Fx: 205-849-5075
matt...@jordanmachine.com
http://www.JordanMachine.com


Lutz Scheffler

unread,
Jun 5, 2020, 12:33:43 PM6/5/20
to Thor, the Tool Manager for FoxPro
Hi Matt,

I have not downloaded or cloned BeautifyX itself. Just some wonders Thor has done.
So, you say this is a kind of side-load from Thor that Thor put into a directory controlled by git?
With all sources and stuff? This is odd.

Anyway, let me know how to solve it. I found a solution so far. Hope it's with minimal harm.

Lutz
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

Matt Slay

unread,
Jun 5, 2020, 1:28:55 PM6/5/20
to 'Lutz Scheffler' via Thor, the Tool Manager for FoxPro

>> Anyway, let me know how to solve it...

PEM Editor, which precedes Thor, has many good tools in it that Jim did not want to replicate in Thor or Thor Repository, so, part of the design of Thor is that is knows how to find PEME Editor on your system, if installed, and it will then invoke the corresponding PEME funciton/service for you.  May people see this as "Thor" doing the work, but it's really just invoking PEM Editor functionality to do it.  If one removed PEM Editor from their system, but kept Thor / Thor Repository, they would have some pain as certain things would quit working.

So, I already explained how to update this:

I said:  "...The Fork/Fix/Pull-Request will have to be done on the PEM Editor repository, then whoever is maintaining the PEM Editor project will have to update the download endpoint for PEM Editor so Thor Check For Updates will see the new version."

PEM Editor source on GitHub: https://github.com/VFPX/PEMEditor  



Eric Selje

unread,
Jun 5, 2020, 1:32:48 PM6/5/20
to FoxPr...@googlegroups.com
It's not ideal that some of these utilities are part of PEM Editor so if you wouldn't mind refactoring everything while you're in there that'd be great.

;)

E


--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FoxProThor/e127a164-8534-3815-d54f-4e97e7098c32%40jordanmachine.com.

Matt Slay

unread,
Jun 5, 2020, 1:45:55 PM6/5/20
to FoxPr...@googlegroups.com

BTW - there is tons of nice documentation that Jim made about the BeautifyX tools.

BeautidfyX options: https://github.com/VFPX/PEMEditor/blob/master/Documentation/pemeditor_tools_beautifyx.md

Indeed, the inter-weaving of Thor and PEM Editor is on great display here, because the doc link above shows (outdated information) that those BeuatifyX options are available from within PEM Editor Preferences, but they are no longer there, as they have been moved to Thor Options settings.

Lutz Scheffler

unread,
Jun 5, 2020, 2:22:44 PM6/5/20
to Thor, the Tool Manager for FoxPro
Hi Matt,

I don't like to like like I'm picky. But, since it was June the 4th, I can remember what I have done:
  1. I haven never used, cloned or downloaded PEME or Thor before June the 6th.
  2. I have cloned Thor from github https://github.com/VFPX/Thor.git
  3. I started Thor.app
  4. Thor started a lot of updating and stuff.
  5. I looked a bit through settings
  6. Opened a primitive method and run the Create LOCALS tool against it
  7. Run into the failure as above
  8. Started the thread and started to debug
Since the PEME is located under Thors working path in Thor\Tools subdir, with full source, I've assumed it belongs to Thor. This is what one assumes is something sits in a gited working dir..
I see now that the Thor subdir is not part of the cloned repo - a git add . has changed that in my clone -

I'm not responsible for the mix of cloned and downloaded stuff. It should have been kind of a submodule or placed outside Thor instead of plain download.

So I have misunderstood this, but you are on the wrong path too.

:)

Lutz

Lutz Scheffler

unread,
Jun 5, 2020, 2:53:23 PM6/5/20
to Thor, the Tool Manager for FoxPro
I found myself very frustrated with this.

Matt Slay

unread,
Jun 5, 2020, 3:11:16 PM6/5/20
to FoxPr...@googlegroups.com

Indeed what-comes-from-where can get confusing, especially if actually run Thor from the directory that you cloned it to.

When Thor "Check For Updates" runs (and this might happen on the first running of Thor too, I can't recall), you can select additional community "Apps" or "Components" that it is aware of and it offers them in a nice download/install form. These are not part of Thor, mind you, just ones that Thor helps people get by designing a system to pull them down and integrate them with Thor (where possible). 

The "App" vs "Component" is an important distinction... I think "Apps" are more integrated (with Thor) and it can launch and (maybe) interact with some of them, and "Components" are more like things you would use within your app  at runtime, or perhaps manually use them from the IDE.

I think if you rare going to maintain source code or Git on any of the Thor, Thor Repository (Tools and Procs folders), or any of the Apps or Components, it's not really going to be easy to do the code maintenance from the same place as your actual working instances of each of these tools, because you'll wind up with nested Git Repos, and I've always had trouble with that.

It seems like one might need a separate clone folder for each repo you want to do work on, then copy or "deploy" your the newest version(s) to your local Thor working folder also.

(BTW - I hope I'm help people understand things better, instead of making them more confusing.)

When I do code edits on my GoFish or Dynamic Forms community tools, I have code repos outside of Thor folder, and never work within there on code edits.


Here is what *my* Thor folder tree looks like... Notice "PEM Editor 6" under Tools/App/ folder.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FoxProThor/397b2853-282e-4b08-92bf-f655e397ef3co%40googlegroups.com.

Tore Bleken

unread,
Jun 5, 2020, 3:14:54 PM6/5/20
to FoxPr...@googlegroups.com

It's the same with SuperBrowse, it's also "automagically" installed as it's considered a part of Thor itself.

 

Tore Bleken

Matt Slay

unread,
Jun 5, 2020, 3:36:34 PM6/5/20
to FoxPr...@googlegroups.com

Jim Nelson

unread,
Jun 5, 2020, 4:05:22 PM6/5/20
to FoxPr...@googlegroups.com
Some background:

PEM Editor existed for a number of years before Thor came on the scene.  A large number of features became embedded in PEM Editor that would not be perceived as part of its original design; this was done because there was no other good delivery vehicle for those features.

Thor was created as a delivery vehicle for tools.  Thor itself only provides for downloading of VFPX projects and other tools and a UI to create menus and assign hot keys to access such tools.  Actually, it is a very tiny app.

Thor comes with a suite of tools called the Thor Repository.  These are tools created by a large number of users throughout the Fox community.  Making them part of the repository allows for easy distribution throughout the community.  Tore's SuperBrowse is one of those tools.

Thor also has tools which access some of the features that are part of PEM Editor so that they could be accessed without having PEM Editor open.  However, the features themselves are closely interwoven into PEM Editor; extricating them would not be a simple task.











Lutz Scheffler

unread,
Jun 6, 2020, 4:23:38 AM6/6/20
to Thor, the Tool Manager for FoxPro
Hi Jim,

thank you for the insight.

To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

--
Matt Slay, President
Jordan Machine Co.
355 Clow Lane
PO Box 170339
Birmingham, AL 35217
Ph: 205-849-5050
Fx: 205-849-5075
matt...@jordanmachine.com
http://www.JordanMachine.com

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.

To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

Lutz Scheffler

unread,
Jun 6, 2020, 4:38:34 AM6/6/20
to Thor, the Tool Manager for FoxPro
Hi Matt,

Yeah was not on the place I would look for it.
I think we boomers have to learn a bit more.with git and github. ;)
The installer or so to say the release belongs to https://github.com/VFPX/Thor/releases.

My project is wrong on this too. I maintain a gilab instane for my professional stuff and learned to the release function recently.

Also the conflicts in naming. A repository is a distinct in git contect. To have a ThorRepository (a repository of Thor functions in Thors sence) is confusing. Looks like a buzz word gone wild. So poor me was (and is) confused.

To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

--
Matt Slay, President
Jordan Machine Co.
355 Clow Lane
PO Box 170339
Birmingham, AL 35217
Ph: 205-849-5050
Fx: 205-849-5075
matt...@jordanmachine.com
http://www.JordanMachine.com

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.

To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

Lutz Scheffler

unread,
Jun 6, 2020, 4:43:48 AM6/6/20
to Thor, the Tool Manager for FoxPro
Thank you for the ideas. I will try from scratch and see how it fits.

The repos are forked and I will work through this forks.

Lutz Scheffler

unread,
Jun 7, 2020, 11:10:55 AM6/7/20
to Thor, the Tool Manager for FoxPro
This seems to be only half of the truth. The settings interface is at https://github.com/VFPX/ThorRepository

OMIPU!

Am Freitag, 5. Juni 2020 18:12:37 UTC+2 schrieb MattSlay:

Koen Piller

unread,
Jun 7, 2020, 11:17:48 AM6/7/20
to Thor, the Tool Manager for FoxPro
Lutz,

Kindly explain what do you mean with OMIPU!  ???

Stay healthy,

Koen

Op zo 7 jun. 2020 om 17:10 schreef 'Lutz Scheffler' via Thor, the Tool Manager for FoxPro <FoxPr...@googlegroups.com>:
--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.

Lutz Scheffler

unread,
Jun 7, 2020, 3:26:08 PM6/7/20
to Thor, the Tool Manager for FoxPro
?STRTRAN('OMG!','G','IPU')


English and in particular German goes more into deep..

Stay well.

Lutz

Am Sonntag, 7. Juni 2020 17:17:48 UTC+2 schrieb Koen:
Lutz,

Kindly explain what do you mean with OMIPU!  ???

Stay healthy,

Koen

Op zo 7 jun. 2020 om 17:10 schreef 'Lutz Scheffler' via Thor, the Tool Manager for FoxPro <FoxPr...@googlegroups.com>:
This seems to be only half of the truth. The settings interface is at https://github.com/VFPX/ThorRepository

OMIPU!

Am Freitag, 5. Juni 2020 18:12:37 UTC+2 schrieb MattSlay:
So, the Fork/Fix/Pull-Request will have to be done on the PEM Editor repository, then whoever is maintaining the PEM Editor project will have to update the download endpoint for PEM Editor so Thor Check For Updates will see the new version.

PEM Editor source on GitHub: https://github.com/VFPX/PEMEditor





--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

Eric Selje

unread,
Jun 7, 2020, 6:11:38 PM6/7/20
to FoxPr...@googlegroups.com
That's great - I'm going to start using that too. :)

To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FoxProThor/bf9866ac-1ba9-434f-8e28-5d647cbeca9do%40googlegroups.com.

Lutz Scheffler

unread,
Jun 8, 2020, 12:15:55 PM6/8/20
to Thor, the Tool Manager for FoxPro
So, now it seems to work.
I have the bug fixed and added two settings.

Do I understand right that I need to push towards the ThorRepository as well as to PEMEditor? At least that is what I see where the code is placed.

Koen Piller

unread,
Jun 8, 2020, 12:58:13 PM6/8/20
to FoxPr...@googlegroups.com
Lutz 
Bug fixed??
My beautifyx works as a charm? What did you rectify?
Koen

Op ma 8 jun. 2020 om 18:15 schreef 'Lutz Scheffler' via Thor, the Tool Manager for FoxPro <FoxPr...@googlegroups.com>
So, now it seems to work.
I have the bug fixed and added two settings.

Do I understand right that I need to push towards the ThorRepository as well as to PEMEditor? At least that is what I see where the code is placed.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
--
Verzonden vanaf mijn iPhone

Lutz Scheffler

unread,
Jun 8, 2020, 4:07:40 PM6/8/20
to Thor, the Tool Manager for FoxPro
Not the BeautifyX, the Create LOCALs;

Bug from OT:
LOCAL;
 lnVar

Original code fails on semicolon directly after LOCAL (or the like). lnVar will by in the new list.

This processing is changed, so words parsed have the trailing semicolon removed in all BeautifyX

After that I've decided that I like to have the var list created in the manner above, make the commas in this list respect the settings from BeautifyX (so I can create without space) and align the AS clauses in LOCAL declaration created.
The output for as and the types now follows the Beautify settings.
Output (my prefered style).
LOCAL;
 lcLines AS CHARACTER
,;
 lnVar   AS NUMBER
,;
 lnVar1  AS NUMBER


So I ended up with two new properties for settings - that's the change on ThorRepository.

Jim Nelson

unread,
Jun 8, 2020, 4:19:37 PM6/8/20
to FoxPr...@googlegroups.com
This whole thread is a prime example of TAOMB -- it just took ten years for it to surface.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.

Lutz Scheffler

unread,
Jun 9, 2020, 1:19:41 AM6/9/20
to Thor, the Tool Manager for FoxPro
My fault. I'm was unable to start with this great tools before. Now I'm in the mood and found some time to have a look into it.

;)

Lutz Scheffler

unread,
Jun 9, 2020, 1:31:57 AM6/9/20
to Thor, the Tool Manager for FoxPro
Additional problem with inline comments

lnVar=1&&

text to mu textemerge
&& Start
Some useless text
endtext
&& end

This is, while ugly, perfect VFP code.

And, doubtless, this is also a valid code snippet
text;&&NiceLineWithComment
 to mu textemerge
&& Start
Some useless text
endtext
&& end


Plain GetWordNum will return a lot of fun.
Finaly, an approach with RegExp to split the lines might have been faster and more easy. (The pattern might be a brain squeezer, but possible)

Bhavbhuti Nathwani

unread,
Jun 9, 2020, 1:35:46 AM6/9/20
to FoxPr...@googlegroups.com

Now what is TAOMB? :)

Kind regards

Bhavbhuti

Message has been deleted

Lutz Scheffler

unread,
Jun 9, 2020, 3:51:12 AM6/9/20
to Thor, the Tool Manager for FoxPro
There we go.

Try the following (it is a way to turn the normal Beautify off in a code block), Poor way to do an indent on complex SQL
BeautifY respects this as well:
#IF .F. THEN
 TEXT TO
NoNo
#ENDIF &&.F.

*Code here will not be touched Beautify, but is regular code, not textblock

#IF .F. THEN
 ENDTEXT
#ENDIF &&.F.
but
#IF .F. THEN
 TEXT TO
NoNo
 SELECT
#ENDIF &&.F.
oops.

also nice (With select formating in textbloks on). In CursorAdapter I use TEXT .. ENDTEXT to create VFP SQL like
***<SelectCmd>
TEXT TO lcTemp NOSHOW TEXTMERGE PRETEXT
7
SELECT
 
Cur1.*,
 
Cur1.l1F1 AS l1F1_1
 FROM
<<lcDBC1>>!<<lcTable1>> AS Cur1
 WHERE
Cur1.iTyp=dnTyp_Baustellen
 ORDER BY
2
ENDTEXT
lcTemp
= STRTRAN(lcTemp,CRLF," ")
lcTemp
= STRTRAN(lcTemp,dcTab,"")
THIS
.SELECTCMD = lcTemp
***</SelectCmd>

Now we got a little hickup here

Jim Nelson

unread,
Jun 9, 2020, 8:42:55 AM6/9/20
to FoxPr...@googlegroups.com
Bhavbhuti  -

How nice to hear from you again!  It's been a long time ... hoping all is well.

TAOMB ::  There's Always One More Bug  



Lutz Scheffler

unread,
Jun 9, 2020, 9:38:55 AM6/9/20
to Thor, the Tool Manager for FoxPro
- Abbreviations of SELECT DELETE UPDATE SQL do not work (while ugly)

- If a SQL SELECT is beautified and and AND is on new line, the semicolon on line above has an additional space in front.

Lutz Scheffler

unread,
Jun 10, 2020, 8:00:06 AM6/10/20
to Thor, the Tool Manager for FoxPro
Fixing a bug will add two, more complex ones.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.


--
Jim Nelson

(805) 498-9195 (preferred)
(720) 837-3536 (cell)
--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxPr...@googlegroups.com.

Jim Nelson

unread,
Jun 10, 2020, 8:19:40 AM6/10/20
to FoxPr...@googlegroups.com
99 little bugs in the code
99 little bugs
fix a bug, run it again
100 little bugs in the code ....


Sent from my iPad

On Jun 10, 2020, at 5:00 AM, 'Lutz Scheffler' via Thor, the Tool Manager for FoxPro <FoxPr...@googlegroups.com> wrote:


To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FoxProThor/3e4e5a36-ac3b-46a0-b37e-3e0668a33234o%40googlegroups.com.

scheff...@googlemail.com

unread,
Apr 13, 2021, 12:53:55 PM4/13/21
to Thor, the Tool Manager for FoxPro
This is a while - but still recent.

The stuff discussed here is working for me for a while. What I do not understand is how to create an upload, since the interface is in ThorRepository and the code in a different repo.

How to upload the changes (for you to check)?
Reply all
Reply to author
Forward
0 new messages