PDA

View Full Version : Studio wierdness



Mike Cooper
21-Apr-2020, 04:15 PM
Now maybe it was me but 3 times this afternoon this line


Find eq GT_CONTENT by Index.1



ended up in the code as



Find eq GT_CONTENT



I suppose that it is possible that I mis-typed it, but I have never had a habit of doing that on a find statement and it has happened 3 times today in a 4 hour period. Of course, I don't notice it until I compile (Compiles without an error), but in the testing something isn't right and when I check the code the "by index.1" is missing.

Has anybody else experienced this in DF20?

I had another oddity twice today where it changed "Set Location to..." to "Set cation to.."

TIA
Mike

Garret Mott
21-Apr-2020, 04:27 PM
This is the 2nd "oddity" you've run into like this, no?

When I run into things like this, I uninstall the studio, reboot, reinstall & usually the problem goes away. I generally figure on doing this 4 or 5 times/year.

Mike Cooper
22-Apr-2020, 03:47 AM
I've never had to do that before, but suppose it may become a necessary part of the deal for now. And yes, I've been getting a few wierd things happening "sans explanation"

Dennis Piccioni
22-Apr-2020, 08:51 AM
Hi Mike,

sorry I don't know about the Studio issues you are encountering.

But: You can change

Find eq GT_CONTENT by Index.1
to

Find eq GT_CONTENT by 1
This has been our recommendation for some time now. "Index." only goes up to 15 and SQL backends allow more indexes and just using the number works.

Mike Cooper
22-Apr-2020, 09:44 AM
Thanks Dennis

phvwijk
22-Apr-2020, 12:20 PM
Always was wondering why in there are index names in the int files.
Was sort of expecting those names could be used when searching on the index.

So in the int file you have



INDEX_NUMBER 9
INDEX_NAME MY_Index_9


So you could used in the studio



Find EQ My_File by MY_Index_9



And code sense would give the index names.

Then it makes sense to give the index names more explainable names.

No more numbers. No more Index.N which only works to 15


Peter

phvwijk
22-Apr-2020, 01:20 PM
Adding to it. Yes the index names in the int file are for the correction information needed. But when you work with the studio for sure if you convert from dataflex there generic names. When you create new table against a SQL database you can give the names.

I would not mind the following

The index names added to the fd file.

Some like #REPLACE My_File_Index_9 |FX9


You can uses the index names in the studio with code sense
When you hoover over the index name you see what segments or ordering the index has


To me working with numbers is a bit how, I do not know how which old version of dataflex, needed to be coded with the number of the file and the field number.


We can add some refactoring to convert the source code in using the new names.


Peter

Garret Mott
22-Apr-2020, 01:30 PM
I would love to have named indices: Find GT FileName by Index_NameCode or some such. It'd make code clearer & with good naming would eliminate the need for comments: Find GT Customer by 2 //Name, ID

It was hard to remember 15 #'s - 20 or more is even worse for my little brain.

Marco
22-Apr-2020, 05:05 PM
[emoji106]

DaveR
23-Apr-2020, 12:55 PM
[emoji106]

ditto, +1 etc

Michael Mullan
23-Apr-2020, 01:24 PM
I think your keyboard is broken...

Mike Cooper
23-Apr-2020, 05:24 PM
Wouldn't that be nice.. no such luck

Sent from my LM-Q910 using Tapatalk

seanyboy
27-Apr-2020, 10:58 AM
You can already redefine indexes. I'm not sure how useful it is. There's no editor codesense on the new names, but it is possible.


Open arhead
Define arhead_invCust_idx for 1
Find gt ARHEAD by arhead_invCust_idx
Send AssertEqual ARHEAD.INVOICE# "874157ADJ" "Search by renamed index.1 %1 = %2"