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 - Patrick Denny

#1
Thanks for the reply, but...

I setup the START_UP program, and it is being executed, but the VIEWER window still suffers from "connection dropped" issues after so long. I had another window open for editing code which was left unattended for about 1.5 hours and that window remained "alive" while 2 other VIEWER windows "crashed" when I switched back to them.

Is there something else or more I could do to prevent the VIEWER sessions from crashing?
Is a setting of '1' the appropriate value to be using?

Obviously there is "inactivity" on the VIEWER connection.  Is there something more that could be done to "create activity", if that makes sense or is possible?
#2
Re: Sending printer output to *VIEWER* / VIEWER

How can I set a system parameter, specifically '+A'=1, for "Keep Alives" when using the *VIEWER*?

I am able to keep my running programs alive using:
    SET_PARAM '+A'=1
in my START_UP program when launching Windx (appserver).

But the *VIEWER* always times out after X amount of time.

I would appreciate if you can include an example rather then just making a statement like "include it on the OPEN command".

I have tried including: -+A=1  (and various iterations and positions in the target line)
on the "target line" on the windows shortcut, but this parameter must be one of the parameters that pxplus doesn't recognize when passed on the target line.
#3
I did use ChatGPT-4 and while it did an "ok" job of generating (Basic) code, it often reported issues as "confirmed" and "double checked" that were completely false.  It would take multiple promptings to convince the Chat that it was lying.

You definitely want to CREATE A DOCUMENT to have a "guidelines document" that you are able to upload and maintain to layout preferences (naming conventions, coding guidelines, do's and don'ts, etc.).  This is a document you want to maintain and re-upload often and also have saved for your own sake.  The GPT can "lose it" at times, so you'll want to be able to re-upload when necessary.  Keep it up-to-date!
*** Note: Several times I had asked ChatGPT-4 to recreate my "guidelines document" so that it would be better organized, thinking it would be "better" to have the document in a format that the GPT had constructed. Wrong! I asked it why that didn't work out well and there was something to how the GPT is designed to work with and analyze human constructed information differently than something it constructed itself(?). Just a heads up that it might be better to maintain this documentation yourself(?) unless the new version handles things differently/better now?

You can point the AI to the PxPlus Online Documentation and it does a fairly good job of using it. When coding problems were realized, GPT-4 would often state that it had confirmed syntax against the online documentation, even providing a link to the documentation that it had referenced, often to find that the link was bad and that it had not actually referred to the documentation. I have not made time yet to use GPT-5 which is supposed to be approximately 50% improved in these areas.

I did come across a suggestion for coding projects, suggesting to use "Python" as the programming language to initially create your program in, which ChatGPT does a good job of coding with, then ask ChatGPT to convert the program to your desired programming language. I haven't tried it yet, but that sounds like a great idea.  Establish a working model in Python, then convert to PxPlus.

There's a lot I would like to do with AI to generate code, but it is time consuming to initially setup everything. Hopefully it will get better/faster as upgraded versions are released.

I did have ChatGPT help with confirming a large inventory cost analysis project as a support to my own work and was impressed that it was able to construct a downloadable executable program (in Python) that I could run on my own laptop and feed it data locally.  It did a fairly good job at following my guidelines and suggestions.  Again, CREATE A DOCUMENT that you maintain and upload. I created a separate project document that outlined the needs for this inventory project. Maintaining your own document will reduce your frustration for if and when the AI forgets everything and changes back into a pumpkin.  Maintaining a document was also an interesting exercise in understanding the complexity of what we are often doing!
#4
Wish List / Re: SELECT DIRECTIVE OUTPUT
May 20, 2025, 03:27:19 PM
I did see the *query* option.  My thought was that this would be an "on the fly" option that didn't require a predefined definition.

Thanks for the reply!
#5
Wish List / SELECT DIRECTIVE OUTPUT
April 28, 2025, 12:31:14 PM
Re: SELECT directive.

A nice feature I used excessively in FoxPro was the ability to output the results of a SELECT command to multiple formats.  You could output to:

1) An existing file (APPEND/INSERT).
2) A "created on the fly" permanent physical file.
3) A temp/MEMORY file.
4) A named physical "temp" file, similar to a *MEMORY* file, which would be auto deleted when closed or at the end of the program.
5) Other output formats, i.e. Excel, CSV, Tab Delimited, etc...

I believe the SELECT command syntax was simple:

SELECT ... [APPEND] TO [MEM|TMP|FILE|XLS|XLSX|CSV|TXT|etc] [filename]]

   - Type "FILE" would be an existing file or a file created by the SELECT command.
   - You might need to supply parameters for "created on the fly" files (FILE) and temp file (TMP) output:
       fieldname(type,length,etc){,fieldname(type,length,etc){,fieldname...}}
       If memory serves me, you could "name fields" for your output using an "AS" clause,
         something like: CUST_NUMBER AS CUSTID(C,6), CUST_NAME AS NAME(C,35), ...
          - "C" being character data, "N" numeric, "D" dates, etc..

When the results would be output to *MEMORY* or a named file, you could use that file in a subsequent SELECT command and perform additional data selection, via another SELECT command, to a) "filter" data, b) JOIN the output to another table, c) use your imagination!

I would be able to construct SELECT statements that were optimized to receive filtered output, then use that output to do "more" via additional SELECT commands or as data to use as needed.

With the ability to save and reuse the results, you could feed into "anything": Report Writer, Charts/Graphs, Queries/Lookups (to display the results), etc...  You might load a GRID or LIST_BOX using the results.  I believe that was even an OPTION in various controls, that the data source could be based on a SELECT statement.  You might also need to refresh/reload the control by refreshing the SELECT command at times, based on changing parameters.

This was powerful in that the results could be used "however you want" rather than being confined to a SELECT/NEXT RECORD command structure.  Since the data was auto generated and available for use, there was no additional programming needed to manually save the results to your desired (reusable) output format.
#6
Apparently I don't check for replies either!  :)
Thanks for the reply.
#7
Nomads / Re: Extended Class Validation - Padding Key Value
September 18, 2024, 04:14:57 PM
I feel like this is not what you are looking for, but... (since I already typed it up).
And there are probably other and better ways, and may need to add "error trapping".
Also, seems to me there is a "Dictionary Object" available?  You might be able to extract something from that.

Playing around a bit, you might determine the pad length using:

Assuming the "Customer Number" is defined in the dictionary with a Length of 6 characters and the Type as "LAST SUBSTRING".

OPEN(1,IOL=*)"INVOICE"   !--- Use OPEN INPUT (1,IOL=*)"INVOICE" if file will not be written to.
LET INVIOL$= LST(IOL(1))

LET P=POS("CUST_NUMBER$:[LEN(SEP,SIZ=" = INVIOL$)
!--- Note that "CUST_NUMBER$:[LEN(SEP,SIZ=" is 26 characters long. So P+26 is used in "READ DATA".

READ DATA FROM INVIOL$(P+26),SEP=")" TO L

PRINT L
 Should print 6.
#8
Nomads / Re: Extended Class Validation - Padding Key Value
September 18, 2024, 03:32:57 PM
In the Dictionary, if you define the field with a Length of 6 characters and the Type as "LAST SUBSTRING", it will be automatically padded when written.

I use "LAST SUBSTRING" when CUST_NUMBER$ is the KEY FIELD or when it is a field within the record.

If you're NOT using the embedded IOLIST when opening the file, it bypasses the padding.

Assuming:
KEY =   6 character Invoice Number  (Field Type = LAST SUBSTRING)
Field = 6 character Customer Number (Field Type = LAST SUBSTRING)

OPEN (1,IOL=*,REC=INVOICE$)"INVOICE"
!---
READ DATA FROM "",REC=INVOICE$ TO IOL=IOL(1)   !--- Initialize fields to blank
!---
LET INVOICE.INVOICE_NUMBER$ = "123456"
LET INVOICE.CUST_NUMBER$ = "CASH"   !--- Note: Only 4 characters here
!---
WRITE (1,KEY="123456")    <=== If Using External Key
    or
WRITE (1)    <=== If Using Internal Key

READ (1,KEY="123456")
PRINT INVOICE.CUST_NUMBER$
  Should print "CASH  "    !--- Note: Written padded, 6 characters

#9
Nomads / Re: Convert NOMADS file to XML (need IOLIST)
September 18, 2024, 02:56:08 PM
I'm going to be comparing multiple revised copies of Basic Programs (Line Numbers).
Are you still using Beyond Compare?
Does that work well for Basic Programs including Line Numbers?
You mention sharing a "configuration". Would that be needed for comparing program code?
Thanks in advance for any advice/recommendations.
#10
Language / Re: Disable LISTing on some users/clients
September 08, 2024, 12:24:28 AM
Would you want to password protect the programs?  They'd be blocked unless they obtain the password.
#11
Thin Client/WindX / Re: SSH Conection Keep alive
November 01, 2023, 01:48:08 PM
@JimGwynn

I issued the command:  SET_PARAM '+A'=1
That works great for my Windx session.  I don't get the long delays waiting to reconnect the session, if the session is left inactive for a while.

I don't think that setting would automatically apply to any "*VIEWER*" windows that get launched.
I had a couple (viewer) windows that were still timing out or had a delay in reconnecting.

Were you able to solve that issue also?  How do I get the *VIEWER* windows to launch (generically) with that parameter set?

I see something in the documentation about "system parameters" in the "NOMADS" menu (Utilities, Application Parameter Configuration), but I'm not sure I understand how all that works, or if that's the correct place to put it.

I read that settings in an INI file used when stating PxPlus would also be used when launching *VIEWER* windows, but I don't see where a parameter like the '+A' parameter would be implemented in the INI file.

Otherwise, the *VIEWER* documentation (under "Special File Handling") shows 3 options, with options 2 & 3 appearing to allow passing parameters.
There's a -XT=1 reference on a command line used to launch/spawn a new pxplus session so I assume I could include a -+A=1  also?  although I tried that on my Desktop Shortcut and it didn't seem to work.  If it "should" work, it looks like I need to manage creating a unique SERIAL file and when "CLOSE"ing the serial file output using that file name in the CALL "Windx.utl;SPAWN" command.  Seems like extra "make work" vs. an OPEN()"*VIEWER*" doing it for you somehow.
#12
Programming / Re: Avalara Tax Integration
July 19, 2023, 08:23:03 AM
Thanks Stéphane for the sample code.  I'm sure that will be a help.
#13
Michael,
Apologies for not replying earlier.  Somehow didn't notice the follow up question.
This was on a V10 Windx E-Commerce license.

#14
Programming / Re: Avalara Tax Integration
July 17, 2023, 02:42:33 PM
Does anyone have "sample code" or "routines" developed that you would be willing to share?
I have a customer looking to integrate with Avalara.  Any insights would be helpful.
#15
Nomads / Field Count, Field Separators, Number of Fields
December 04, 2022, 11:13:35 PM
I had difficulty determining the Number of Fields (Field Separators) as defined by a file's internal Dictionary.
Here is the solution I came up with to determine the Number of Field Separators:

LET FCHN = HFN
OPEN INPUT (FCHN,IOL=*)"FILE"
!
LET FCNT = POS(SEP=REC(IOL(FCHN)),1,0) ; REM "---<<< Here's the code >>>
!
CLOSE (FCHN)

You could substitute $8A$ for SEP if that is required?
Use OPEN INPUT vs. OPEN, if doing an immediate CLOSE?

If issuing a DIM array definition, don't forget to reduce the number of array elements by 1, if your first ARRAY element starts at Zero (default).

DIM X$[10]  Creates 11 element array with elements X$[0] thru X$[10]
DIM X$[0:10] Same as above
DIM X$[1:6] Creates 6 element array with elements X$[1] thru X$[6]