Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Mike Hatfield

#16
Nomads / Re: Library Query
May 29, 2024, 01:40:27 AM



Jane,
Example:
I am currently FID T001
My Dictionary definition is "General Ledger Enquiry" and the file name is expression "./WKFL"+FID(0)
When I save the definition it creates the file WKFLT001
There is no data in the file yet.
Now comes the tricky part.....
If I now create the Query GLTR_QRY whilst still on T001....
I have the choice of using the Dictionary definition name or expression.
IF, I am on the same session, IE T001 the Query maintenance 'sees' the physical file whether I define the query as physical or expression and it will pop up the query screen with no data.
IF, I run my program whilst still on T001 the program ruins and the Query runs and all is good.
IF I now start a new session on T003 my program creates the workfile WKFLT003 and fills it with data (*dict/dd_update created the file).
At the end of the data generation the program PROCESSes the query GLTR_Qry
Unfortunately the Query fails because it thinks the source data file is WKFLT001 and not WKFLT003.
It seems to me that when Query goes to the Dictionary to get the real file name, Dictionary replies with the original physical name that was created directly by the dictionary.
In other words if the Dictionary and the Query use expression for the file name the Query always fails UNLESS the Dictionary Maintenance, Query and my program are all in the same session.

In other words using expression for the file name doesn't work when part of the expression is variable - eg FID(0)
Unfortunately, you can't define a query if it can't find the file that contains the data and its dictionary.

#17
Nomads / Re: Library Query
May 28, 2024, 02:48:56 AM
Hi Stéphane
Sometimes what you think is going to be an easy exercise turns out to be impossible.
I have a generic file definition in the dictionary. I use it to create a unique named work file at runtime using *dict/dd_updt. I'm changing a text based program to modernize it with Query. In my program I want to call Nomads Query that will read/process that unique file name with the
generic dictionary definition. Seems to me there is a shortcoming in the Query options.
Being able to do this with Query would save me a massive amount of recoding time to use a regular nomads panel list boxes.
#18
Nomads / Re: Library Query
May 27, 2024, 08:59:37 PM
Hi Jane, I have already tried what you suggested. Please see attached screenshots of the dictionary definition and query definition.
My WindX session was on FID(0)="T001" in the Dictionary maintenance.
Notice that file ending in T0014, FID(0) is "T001", has been created. The number 4 being, I presume, the content of TCB(13).

This code creates the work file in the main program:
I am in WindX session where FID(0)="T003"
01031  KEYED "WKFL"+FID(0)+STR(TCB(13)),[1:1:2],[2:1:8],[3:1:8],[4:1:3],0,79
01040  OPEN (FILECHAN)"WKFL"+FID(0)+STR(TCB(13))
TCB(13) AT THIS POINT IS 0

See screenshot - query running.
Notice the WKFL" file is defined for "T003 - Correct, but the TCB(13) is 6.
I presume the TCB value is associated with the call level in the stack.

Doesn't matter how I name/define the workfile, by the time the Query wants to read it the name is different because of a random TCB(13) number.
There must be a way to do this. I don't want hundreds of temporary workfiles cluttering up the disk.
#19
Nomads / Library Query
May 27, 2024, 05:12:28 AM
I want to create a Stanard Library Query where you pass it the file name to open for the query.
For example:
I want to create a query that will display a workfile that contains a set of transactions from the general ledger.
The workfile has a generated unique file name: EG GLWK+fid(0)+TCB(13)
I can create a File Dictionary table for a generic GLWK workfile.
My problem is how to tell the Query what file to read and how will it know to use the generic dictionary definition?

Thanks
#20
ODBC / Re: ODBC with latest MS Excel
May 09, 2024, 05:29:31 PM
Hi Devon & Tom,

I see that you found the same solution as I did.
Thanks to all for the responses :)
#21
ODBC / Re: ODBC with latest MS Excel
May 09, 2024, 04:54:37 AM
Hi Ken, That is true but it doesn't allow the selections from the PxPlus ODBC 32/64 interface.

Typical of Microsoft to remove a feature that half the world uses without any explanation of how to work around.
However, I have done some research and I believe I have the solution.
You have to click on File - Options - Data
In Show Legacy data import wizards
tick From Data Connection Wizard (legacy)
tick From Microsoft Query (legacy)
OK

Back in the Spreadsheet
Click Data
Click Get Data
then in the Dropdown you will see Legacy Wiards - From Microsoft Queary (Legacy)
Et Voila!!

#22
ODBC / ODBC with latest MS Excel
May 08, 2024, 10:10:34 PM
I see that MS Excel - Data - Get Data - Other Sources- MS Query has disappeared from the latest version of Excel.
How do we now run PxPlus ODBC ?
Thanks
#23
Programming / Re: Spawning a session
April 18, 2024, 09:39:00 PM
What if the application is not Nomads - Character only?
#24
Programming / Spawning a session
April 18, 2024, 01:34:40 AM
Hi All, I'm running a plus/cs windx session.
I want to be able to open a new window/session from the current program.
In that new window I want to have it run a program that will display some lines of customer information text. When I find the text I want to switch back to the calling windx session and be able type in some of the text. When I'm done I want to close the new window/session either by clicking on the new session 'x' or issuing a close/drop or whatever in the calling program.
 
Would you believe in the nearly 26 years of programming with Pvx/PxPlus I've never had occasion to do this.
Is this accomplished by spawning a session or is there an easier way. I did do a test with *plus/cs/spawn. It gives me a new session window but none of the global variables from the calling application.
If this is the correct approach how would I place the following in the spawn argument cmdline   -  PROCESS "ARCM_INFO",%PATH_ROOT$+"dictionary/SM_CZ.EN",R2$

I don't seem to be able to do this with a dialogue window. IE Once inside the dialogue window you can't swith back and forth between the dialogue and calling program.

Thanks
#25
Programming / Re: TCB(44) Always a Positive Number?
July 10, 2023, 11:52:52 PM
Our office is in Brisbane Australia - currently UTC+10
It's 13:52 here
TCB(44) is -36000
#26
Many moons ago in the days before self-expanding files we wrote a utility program to change key size, change record length and the number of records in the file. I think I was a lot younger then  :-\
#27
iNomads / Re: iPad device for remote support
April 11, 2023, 05:26:49 PM
Great Mike, looking forward to trying this on the new release.

As an aside....If you are looking to support the linux platform in general, then ANYDESK is a good option if you don't have access to tools like Connectwise Screenconnect. Anydesk will run on all common platforms. It is free for 'personal' use. It is also the only support tool we have found that will give you mouse/keyboard support from windows to an Android/IOS tablet. For example, if you are running an application, telnet session or soon to be iNomads from a tablet to a PxPlus host.
#28
Programming / Re: Strange if then else behavior
March 09, 2023, 12:29:54 AM
Ok, got it.
Is this what I should see? The listing includes the internal generated line numbers so that you can edit at the command prompt ?
:
-}list edit set_userid,
0071 Set_userid:
:
0072       IF NOT(%inomads'ForceLogon) AND %inomads'LogonReqd$<>"Y
:           THEN LET %inomads'Userid$=NID;
:                RETURN
0075 !
0076       DEF UID="*Void*" LOCAL
0077       CALL "*secure","F:LOGIN"
0078       DEF UID="*"
0079 !
0080       IF %inomads'Userid$=""
:           THEN EXITTO SKIP_TX
0082 !
0083       IF %inomads'use_signon_uid
:           THEN GOSUB Linux_signon WITH reqd_uid$=%inomads'Userid
0085 !
0086       RETURN
0087 !
0088 start_trace:
:
0089       LET x$=PTH("*plus/inomads/tracefiles",ERR=*RETURN)
0090 !
Press <ENTER> to continue or <F4> to exit:

#29
Programming / Re: Strange if then else behavior
March 08, 2023, 06:15:22 PM
Hi Mike, I had no idea you could do a LIST EDIT..... from the console prompt. very handy I think.
So, I thought I'd try it on the inomads program. The IT editor is set to 'editted list' and 'disallow lines'

I get this

-}LIST EDIT SET_USERID
0071 Set_userid:
:
Am I missing a setting somewhere?
Thanks
#30
Hi Devon,
I defined the class DATE-YYMMDD and it works. So simple and so obvious!
I have been trying all sorts of combinations around DATE-AAMMDD thinking that would be the right way to go.
Thinking about that I remember back to the Y2K 'bug' that this is specific to that point in time.
Thanks for the reply.

Follow-up question:
for the Class 'DATE' the element is auto-filled with 00/00/0000 and FMT=DD/MM/YYYY,DAYFMT=YYYYMMDD,INP=00/00/0000
for the Class 'DATE-YYMMDD' would an equivalent be 00/00/00 and FMT=DD/MM/YY,DAYFMT=YYMMDD,INP=00/00/00

Thanks again