PxPlus User Forum

Twitter Twitter Twitter

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.


Messages - Jeff Wilder

Pages: [1] 2 3
1
Programming / Re: Jonas Software
« on: May 03, 2023, 10:18:19 AM »
Congratulations! I look forward to seeing more great things from PxPlus in the future.

2
Thin Client/WindX / Re: Force update when using WindX packet compression
« on: September 07, 2022, 01:48:26 AM »
Thank you Mike! That makes perfect sense. I will change the code to use MSE instead of WAIT 0 when I truly need to force an update which is quite rare.

3
One way I can think of is to create a *cmd program which calls your "CALLED_PROG" instead of using the CALL directive from the prompt.

Code: [Select]
NEW
0010 ENTER arg1$,ERR=*NEXT; GOTO ArgsOK
0020 PRINT "You must supply an argument."
0030 END
0040 ArgsOK:
0050 CALL "CALLED_PROG",arg1$,1
0060 END
SAVE "*cmd/cp"

Change the CALLED_PROG to accept an extra argument:
Code: [Select]
0010 ! CALLED_PROG
0020 ENTER Arg1$,CmdPrompt,ERR=*NEXT
0030 IF CmdPrompt THEN PRINT "CALLED FROM COMMAND LINE" ELSE PRINT "CALLED FROM PROGRAM"
0040 EXIT

Call made from the command prompt:
->cp TEST

Call made from a program:
1010 CALL "CALLED_PROG","TEST"

4
Thin Client/WindX / Force update when using WindX packet compression
« on: August 30, 2022, 06:34:52 PM »
Hello,
I stumbled across an unexpected behavior today and was hoping somebody on here could explain if I am doing something wrong. When the '+W' system parameter is enabled for WindX data packet compression, the UI does not appear to update as I expect it to. Specifically, I sometimes use the WAIT 0 directive to force an update of screen controls while I'm processing something. This is most commonly done for a progress bar for example. When the +W parameter is enabled, the WAIT 0 no longer causes a UI control (screen) update. Below is an example program that illustrates this behavior. I'm using PxPlus 18.20. When the program is executed in a CS client connected WindX session, the print statements are shown after the WAIT directives while +W is off. However, when +W is on, the print statements do not display until the program ends. At which time, they all appear at once. Am I using the WAIT directive improperly?

Thank you,
Jeff

Code: [Select]
0010 BEGIN
0020 SET_PARAM -'+W'
0030 FOR 2
0040 PRINT "Hello World!"
0050 WAIT 0
0060 ! Now go off and do some processing....
0070 GOSUB 0160
0080 ! In PxPlus CS WindX, the print statement doesn't print until the program ends
0090 PRINT "Update the display."
0100 WAIT 0
0110 GOSUB 0160
0120 SET_PARAM '+W'
0130 NEXT
0140 PRINT "Complete"
0150 END

0160 ! Emulate some processing code
0170 FOR I=1 TO 7000000
0180 LET X=I/(RND(I)+1)
0190 NEXT
0200 RETURN

5
Nomads / Finding the previous CTL ID on Default Push Button event
« on: October 27, 2021, 06:02:45 PM »
Hello,
I have a Nomads form with several multi_line controls and a button with the Default Push Button property set. When the user presses enter, my button click logic is executed.

My question: Is it possible to know inside that button click logic which multi_line had focus when the user pressed the enter key? All of the Nomads ID related variables appear to point to the button CTL, but I am looking for the multi_line CTL.

Thank you,
Jeff

6
Programming / Re: ENTER using default values
« on: August 25, 2021, 03:47:08 PM »
Can you provide your CALL statement?

Defaults only apply if the CALL did not send in the argument.

For example:
CALL "prog.pxp",in0$,iz$

7
Language / Re: Determine Viewer
« on: June 23, 2021, 03:38:34 PM »
Code: [Select]
PRINT MID(FIB(print_chan),4,6)

8
Programming / Re: PDF viewer cutting off bottom of text
« on: May 26, 2021, 10:16:50 AM »
I made the suggested changes to the application and all is working perfectly now. In fact, it also resolved some other text and line placement issues I was having.

Thanks again Mike!

9
Programming / Re: PDF viewer cutting off bottom of text
« on: May 25, 2021, 06:40:14 PM »
Thank you Mike! I will give that a try.

By the way, I had copied that font scaling code from the PxPlus manual at https://manual.pvxplus.com/PXPLUS/file_handling/_winprt_windev_printing.htm

Regards,
Jeff

10
Programming / PDF viewer cutting off bottom of text
« on: May 25, 2021, 02:33:04 PM »
When I print to the PDF viewer using a scaled font, it sometimes cuts off the bottom of lowercase letters that hang below the line such as g, y, j. It appears to do this whenever I provide the bottom right corner of the text area. I've tried various alignments and sizes for the text area with no change in the results. Below is a sample program and PNG of the output.

Am I doing something improperly? This does not happen when the output is a *WINPRT* device. Including the Microsoft Print to PDF or the Adobe PDF printer.  I believe it is something happening inside *PDF*.

BTW, I am specifying the bottom right corner because I want the text to be cut-off if it is too long for the print area.

Best Regards,
Jeff


Code: [Select]
BEGIN
Cols_Reqd = 102, loop = 0, font$ = "Arial"
OPEN (UNT)"*PDF*;VIEW;MARGINS=500:500:500:500"; prn=LFO

! Scale the font
PRINT (prn)'Font'(font$,-12),'DF',
WHILE (MXC(prn)<Cols_Reqd AND ++loop<5)
PRINT (prn)'Font'(font$, MXC(prn)/Cols_Reqd),'DF', ! Scale the font
WEND

s$="These dangling letters are jetting below the line yet are cut off."
x = 50, l = 1
PRINT (prn)'Text'(@X(1),@Y(l),@X(x),@Y(l),STR(l)+": "+s$,"T"),
l+=2
PRINT (prn)'Text'(@X(1),@Y(l),@X(x),@Y(l+2),STR(l)+": "+s$,"T"),
l+=2
PRINT (prn)'Text'(@X(1),@Y(l),@X(x),@Y(l+3),STR(l)+": "+s$,"T"),
l+=2
PRINT (prn)'Text'(@X(1),@Y(l),@X(x),@Y(l+4),STR(l)+": "+s$,"T"),
l+=2
PRINT (prn)'Text'(@X(1),@Y(l),STR(l)+": "+s$),
END

11
Programming / Re: Embed an IO_PROGRAM
« on: April 19, 2021, 04:32:02 PM »
If you are looking to permanently attach the program to the data file, you will need to set it via the data dictionary. Not sure if this is the current PxPlus method, but I have used the *dict\dictionary object in the past. Below is a simple example to show how this can be done. You should enhance this with the appropriate validation and object return value verification. It is possible to update the data file with an invalid program name which would then make the file impossible to open without error. So be careful.

Code: [Select]
0010 BEGIN
0020 LET TABLENAME$="YourTableName" ! The data dictionary table name
0030 LET DB=NEW("*dict\database")
0040 IF DB'SETDATABASE("") THEN {
0050 LET T=DB'GETTABLEINFO(TABLENAME$)
0060 LET T'IOPROGRAM$="YourProgram.pvp"
0070 DB'UPDATETABLE(T) ! Update the providex.ddf data dictionary file.
0080 DB'ADJUSTTABLE(TABLENAME$) ! Update the physical file's embedded dictionary information.
0090  }
0100 DROP OBJECT DB
0110 END 

If you only need a program for temporary operation, you can use the SETDEV PROGRAM syntax.

Regards,
Jeff

12
Language / Historical File Splitting (*obj\multifile.pvc)
« on: April 16, 2021, 05:31:41 PM »
Hello,
I am testing the integration of the Historical File Splitting functionality into an existing application and have run into a couple of snags. I'm not sure if I'm using it incorrectly or I have found a bug in PxPlus 15.10.

First, when I set the key information as Ascending or Descending, reading the file with the SELECT/NEXT RECORD directive with a BEGIN and END value either returns no records or incorrectly starts at the beginning of the file no matter the BEGIN value. My file has a multi-segmented internal key which is ascending and made of column 1 and column 2 data. When I set the key information to None, the file behaves as normal. Perhaps I have just misunderstood how this i supposed to work. Maybe someone could provide a working example? I would like to take advantage of the optimization mentioned in the manual as these files will be quite large even when split.

Also, there are parts of the application which still require the BX parameter. (working to remove those)  When the BX parameter is on, the logic inside *obj\multifile.pvc breaks when using KGN or the key definition. I've got a hack to disable the parameter when using the multi-segmented file, but thought there might be an explanation or fix for this?

Thank you,
Jeff

13
Web Services / Re: Custom content for http error responses
« on: March 12, 2021, 05:42:55 PM »
Thank you Mike. That is excellent! I can't wait to try it out.

Dirk, I wrote my REST web service for the PxPlus web server before PxPlus 2014 was available. If doing it today, I would most likely use the method Mike referenced in the manual.

Regards,
Jeff

14
Programming / Re: Converting UTC to local time
« on: December 22, 2020, 01:32:50 PM »
Thank you again Mike. That will work for my needs.

I will also try something similar in Powershell for Windows installations.

Code: [Select]
0010 BEGIN
0020 LET D$="2020-06-15T15:00:00"
0030 LET C$="$strCurrentTimeZone = (Get-WmiObject win32_timezone).StandardName;$TZ = [System.TimeZoneInfo]::FindSystemTimeZoneById($strCurrentTimeZone);$LocalTime = [System.TimeZoneInfo]::ConvertTimeFromUtc('"+D$+"', $TZ);$LocalTime.GetDateTimeFormats('s')"
0040 OPEN (1)"|powershell.exe -Command ""&{"+C$+"}"""
0050 READ (1,ERR=*NEXT)A$
0060 PRINT A$
0070 END

Thank you Allen, but the TCB(44) function returns the current offset. I need to know what the offset will be on any given date.

Regards,
Jeff

15
Programming / Converting UTC to local time
« on: December 22, 2020, 11:54:22 AM »
Hello,
I have a situation where I need to convert a supplied UTC date and time to the user's local date and time for display.  These may be dates in the past or future.  I am unsure of the best method to do this because of the potential for the user's local time zone to use daylight saving time. I am aware of TCB(44) and TCB(45), but those only apply to the current date. To properly convert the time, I need to know if the user's local time zone will observe (or had observed) DST on a specific date (or if their time zone even observes DST).

Does anyone have any tips, tricks, or routines that can properly handle this?

Thanks,
Jeff

Pages: [1] 2 3