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 - Mike King

Pages: 1 2 3 [4] 5 6 ... 66
46
Programming / Re: From It run program - debug window too short
« on: January 09, 2024, 11:56:05 AM »
When you run a program from within IT using F7, the menu Debug >> Debug current program, or the menu option Run >> PxPlus the system will spawn a new instance of PxPlus using the default window size.  The default consists of an 80x25 window inside a window frame container whose dimensions is set in your INI file in the [WindowFrame] section.

Generally I suggest that you override these by providing a START_UP program that sets whatever you want as a minimum window size by calling *cmd/system/wdw and passing the size desired as WWxHH (e.g. "100x30").  This will create the base window the size desired, however you will still need to adjust the outer frame size to suit your needs.

You could also try adding the following commands to your START_UP:

CALL "*cmd/system/wdw", "100x30"  ! Or whatever your desired minimum cols/lines might be
CALL "*cmd/system/wdw", "zoom auto"


This will tell the system to create a 100x30 window then adjust the font size so you end up with the desired window size (in terms of columns/lines) within the frame and to tweak the frame size to match the window size.  The auto option enables tracking any frame size adjustments made by the user and have the system adjust the font accordingly.

47
Thin Client/WindX / Re: Auto Updater
« on: December 19, 2023, 11:27:31 AM »
Assuming you just need the standard WindX plugin updated in the standard location you could have whatever version of WindX currently is installed download the desired WindX installer then run it.

By default each version installs in a different directory so you can install a newer version from any existing version. 

Now you would need to make sure the user knows you are doing this so they let the install take place and haven't disabled remote shell requests, although you might consider running the installer silently if you felt that worked better for your application.

Once installed have the old WindX change whatever desktop shortcut is used to launch WindX on the users workstation using Wscript.shell.


48
Programming / Re: Memory leak? Something not being freed?
« on: December 15, 2023, 12:32:46 PM »
To see what you have open, on Windows click on the icon in the upper left (or press ALT-SPACE) then select About PxPlus.  From there select the info button.  This will show you all files, windows, controls and object you are using.

Also, to avoid unwanted left over objects, always consider adding a FOR clause when creating an object with the NEW function which will allow you set dependencies on the new object which will allow for automatic deletion.  For example if the object is only used in a subroutine while its active you could add FOR PROGRAM.

49
Wish List / Re: string interpolation
« on: December 14, 2023, 11:46:40 AM »
Actually here is a simple object that you can use to accomplish what you are looking for:

Code: [Select]
  def class "string"
  function perform Eval$(string$)
  local _.x$,_.o
  enter (_.x$)
  _.o=pos("\"=_.x$)
  if _.o \
   then _.x$=sub(_.x$,"\{",$01$);
        _.x$=sub(_.x$,"\}",$02$);
        _.x$=sub(_.x$,"\"+quo,$03$)
 !
  translate _.x$,"{"+chr(6)+"""+STR("+"}"+chr(3)+")+"""
  _.x$=evs(quo+_.x$+quo)
  if _.o \
   then translate _.x$,$01$+chr(1)+"{"+$02$+chr(1)+"}"+$03$+chr(1)+quo
  return _.x$
  end def

Basically you can pass it a string with values/expressions to expand surrounded by curly braces.  If you want to input actual curly braces or a quote in the output string, prefix them with a backslash.  For example:

->name$="Tom"
->o=new("string")
->print o'Eval$("Hello, {name$}! Today is {day}")
Hello, Tom! Today is 12/14/23


If the string has an error such as unmatched curly braces or a invalid value/expression the error will be returned to the caller.

50
Programming / Re: Multi-Line SELECTOFFSET, SELECTLENGTH, SELECTTEXT$
« on: December 11, 2023, 11:00:52 AM »
Oh and if you really want to use a single line input and have access to 'SelectOffset, 'SelectLength, etc., use a POPUP menu on the control.

Windows will NOT clear the selection if you right click to invoke the popup menu for the control so in your popup menu logic you can access the selection information.

This is how Windows handles this -- Anything looking to access the selected text generally does so from a Right click popup especially when dealing with single line input fields.

51
Programming / Re: Multi-Line SELECTOFFSET, SELECTLENGTH, SELECTTEXT$
« on: December 11, 2023, 09:58:51 AM »
What you are seeing is normal Windows behavior. 

For example if you run any windows application and ask it to open a file, then in the file name field (a single line entry field) enter your text "Hello World Canada", select the second word and press tab to exit the field, you will see that the selected text get automatically unselected.

Only multiple line inputs preserve the selected text in Windows.

52
Programming / Re: Monitor in Portrait Mode can't Maximize
« on: November 23, 2023, 10:47:18 PM »
There is a limit as to the number of lines high a window can occupy.  These limits changed in PxPlus 2021.  What version are you running?

53
Programming / Re: DEF OBJECT WORD
« on: November 07, 2023, 08:48:22 AM »
Version 9 is over ten years old and not supported.  Add to that DDE itself is not technology that Microsoft promotes anymore.

We would suggest you upgrade to a more recent/supported release.  This would allow you to use our interfaces to both Word and Excel.

54
Programming / Re: More Advanced Search Tool Than Integrated Toolkit
« on: November 06, 2023, 09:10:57 PM »
You probably should review Regular Expressions ..

Basically for what you want would be

DIM.*MYVAR

Here is a link to more details about regular expressions which are used by the MSK function:
https://manual.pvxplus.com/page/functions/msk.htm

55
Programming / Re: Link File vs. Prefix File
« on: August 22, 2023, 10:33:12 PM »
Prefix file is a bit less overhead, however link files are often easier to manage and allow you to use the PREFIX directive to control which database you may want to access.

56
Programming / Re: Create an Excel file in Linux environment
« on: August 11, 2023, 08:57:50 AM »
You can find more information about using zip files with PxPlus at

https://manual.pvxplus.com/page/PxPlus%20User%20Guide/File%20Handling/Processing%20Data%20Files/Accessing%20ZIP%20Files.htm

Support for Zip files was added in 2014.

57
Programming / Re: Create an Excel file in Linux environment
« on: August 10, 2023, 04:31:39 PM »
And since PxPlus itself can read/write ZIP files all you really need to do is open the ".xlsx" file directly and treat it as a Keyed file to READ/WRITE the records directly where the keys are the embedded file pathnames.

For example:

->open (1) "test.xlsx
->print key(1)
[Content_Types].xml
->read record (1) r$
->?r$
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/
vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/
workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl
/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override Part
Name="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styl
es.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStr
ings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/doc
Props/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml
" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>
->print key(1)
_rels/.rels
->read record (1) R$
->print r$
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schema
s.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2"
Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relat
ionship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook
.xml"/></Relationships>

Given this you should be able to parse any XLSX file and potentially create new ones.

58
Programming / Re: Accessing a Control on Another Dialog
« on: August 09, 2023, 09:03:36 PM »
It likely would be easier to just use Pseudo control handles.  You can use the *system object to get the handle for any control in the system and then use it anywhere to access the control. 

https://manual.pvxplus.com/page/objctl2/overview.htm

->button 10,@(10,10,10,10)="hello
->osys=new("*system")
->%Btn_handle=osys'Control(10)
->?Btn_handle
 1000100010

59
Language / Re: 'picutre' mnemonic
« on: August 09, 2023, 04:04:17 PM »
Assuming you are running a current version of PxPlus you should simply have to enable the WindX auto-download for images and WindX will forward the image file to a temporary holding directory on the workstation.

This option is controlled by the +U system parameter.

When enabled the pathname in the PICTURE mnemonic should be the pathname to the image file on the host (server) computer and not the workstation.

For further details please see:  https://manual.pvxplus.com/page/windx/autoload.htm

60
Programming / Re: Data Dictionary Update *dict/dd_updt
« on: August 08, 2023, 04:20:02 PM »
There are two types of errors you could received from this utility.

  • The first would be an expected error such as a password failure, invalid table name, etc.  These will be reported in the error message which will be NULL if no error occurred, non-null indicates an error.
  • The second would be a totally unexpected error such as file corruption or IO error.  These can be caught using an ERR= option.

Checking ERR would only be appropriate if an ERR= branch was taken.

Pages: 1 2 3 [4] 5 6 ... 66