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 ... 55 56 [57] 58 59 ... 65
841
Wish List / Re: Enumeration Sequencing
« on: November 08, 2018, 09:05:11 AM »
To suppress the "LET" directive simply set the 'NL' system parameter.

842
Programming / Re: Trace issue baffling me
« on: November 06, 2018, 05:51:05 PM »
What exactly are you questioning and what version WindX are you running? 

I have checked a number of versions and not found a "WriteFile of xx ..." message in our code.

The Recvd Maj/Min and .. Acking messages are normal WindX debug output which is enabled by setting %wdx_dbg on and the <h> is normal Host generated trace output from Nomads.

You probably should forward this to our Helpdesk so someone in support can assist.

843
Programming / Re: Change papersize in viewer
« on: November 06, 2018, 01:37:32 PM »
The non-PDF viewer does not support rendering based on Paper size, however as of PxPlus 2018 update 1 the PDF based viewer does. 

You might want to try this viewer.

844
Programming / Re: FID(0)
« on: November 04, 2018, 01:18:59 PM »
The system doesn’t care or use the FiD value for anything other than as part of a temporary file name. 

It can be pretty much any combination of characters you want but should only consist of printable characters allowed in file names.

845
Programming / Re: SafeArray from Linux
« on: November 02, 2018, 04:39:52 PM »
When running across WindX I generally suggest simply create callable program and put it in *plus/wdx/usr then call it passing the data.

For example create *plus/wdx/usr/loadxl with

Code: [Select]
  enter data$,range$,visible
  xl=new("*obj/excel" for window)
  xl'CreateWorkBook("")
  xl'write(data$,range$)
  xl'visible=visible
  end

Then in the program replace lines 100 thru 150 with

Call "[lcl]*plus/wdx/usr/loadxl",data$."A1:Y1000",1

NOTE: This will keep the Excel object up until you close your current window.

846
Tips and Techniques / Putting Bar charts in list boxes
« on: November 02, 2018, 03:47:16 PM »
One of the great features of PxPlus 2017 is its ability to include bar charts inside of formatted list boxes.  This functionality allows you to present a more visual representation of the data such as sales statistics, usage, and other numerical information.

For example:



Adding bar charts to formatted list boxes is done by using a 'FILL' mnemonic to define the column contents.  The 'FILL' mnemonic, when used in a list box, defines the percentage of the column that you want filled and the color. 

For example, a 'FILL'(50,"Yellow") will fill 50% of the column width with the color Yellow.  If you want multiple bars simply include multiple 'FILL' mnemonics. 

If desired you may also include standard text in the column contents with will be placed according to its position to the 'FILL' mnemonics. Should the total percentage filled plus text exceeds 100%., the contents will be truncated.  Should you want to make sure any text following the bar chart is displayed, keep the total filled less than 100%.

Below is a simple program that uses some hard coded data to show how you can create these type of bar charts.

Code: [Select]
  lv=10
  list_box lv,@(2,5,76,12),fmt="[Product]10C [Desc]15 [QOH]5C [Sold/Day]7C [Delivery]7c [Inventory Status]30",opt="r"
 !
  loaddata$=""
 !
  while 1
  read data productcode$,description$,qtyonhand,soldperday,delivery,end=*break
 !
  delivery=14+rnd(30)
  status=50+rnd(800)/10
  soldperday=(status*qtyonhand)/(delivery*100)
 !
 ! Compute likely state based on sales per day versus delivery time
 !
 ! Status > 100 means Delivery time exceeds days supply
 ! We want
 !
 ! status <= 80 to indicate good status (Green)
 ! status between 80->100 indicates marginal (Yellow)
 ! status over 100 indicates bad status (Red)
 !
 ! We divide all these number by 1.3 to allow for worst case of status of 130
 !
  dayssupply=qtyonhand/soldperday
  status=(delivery*100)/dayssupply
 !
  thebar$='fill'(min(80,status)/1.3,"GREEN") ! Show % good status
  thebar$+='fill'(min(20,status-80)/1.3,"YELLOW") ! Show % marginal
  thebar$+='fill'(min(30,status-100)/1.3,"Red") ! Show % Bad
 !
  loaddata$+=rec(iol=lv_iol)+$01$
  wend
 !
  list_box load lv,loaddata$
  escape
 !
 lv_iol: \
  iolist productcode$,description$,qtyonhand,soldperday,delivery,thebar$
 !
  data "BUS-3110-YLW","Bus - Yellow",684,12.89,32
  data "BUS-3111-CYN","Bus - Cyan",677,10.98,42
  data "BUS-3112-VIO","Bus - Violet",128,3.65,36
  data "BUS-3113-GRN","Bus - Green",173,4.21,41
  data "BUS-3114-RED","Bus - Red",122,3.92,37
  data "BUS-3115-BLU","Bus - Blue",65,3.24,18
  data "CAR-1320-GLD","Safari Jeep - Gold",585,18.75,37
  data "CAR-1321-CYN","Safari Jeep - Cyan",210,7.69,35
  data "CAR-1322-VIO","Safari Jeep - Violet",696,21.18,42
  data "CAR-1323-GRN","Safari Jeep - Green",235,5.72,25
  data "CAR-1324-RED","Safari Jeep - Red",665,27.43,29
  data "CAR-1325-BLU","Safari Jeep - Blue",543,14.39,34
  data "CAR-1410-SLV","Bug - Silver",487,15.03,30
  data "CAR-1411-ROS","Bug - Pale Rose",550,25.09,21
  data "CAR-1412-SEA","Bug - Seagreen",594,16.79,41
  data "CAR-1413-VIO","Bug - Violet",105,2.21,29
  data "CAR-1414-PRL","Bug - Pearl",376,11.56,32
  data "CAR-1415-WHT","Bug - White",151,2.64,39
  data "CAR-2220-PNK","Cabriolet - Fuschia",665,47.84,15
  data "CAR-2221-LME","Cabriolet - Lime",542,14.31,33

Colors:

If desired, you can specify two colors in the 'FILL' mnemonic.  When providing two colors, the first color will be the color used at the top of the bar blending down the second color.  If only one color is given, the system will attempt to shade it slightly with a lighter shade on the top and a darker shade on the bottom.

Grids:

Grids can also include horizontal bars in cells by setting the cell type to BarChart and setting the cells 'Text$ property to the percentage to fill and the colors desired.  Refer to our online documentation on the Grid directive under Horizontal Bar Charts in Grid Cells for more details.

847
Programming / Re: SafeArray from Linux
« on: November 02, 2018, 02:09:41 PM »
Have you tried the PxPlus 2017 Excel object to transfer data or use the OLE interface to update a range in a single command?

Using PxPlus 2018 and the program below it took under 2 seconds to launch Excel and load 1000 rows of 25 columns.

Code: [Select]
  begin
!
  for r=1 to 1000
    for c=1 to 25
    data$+="R"+str(r)+"C"+str(c)+sep
    next c
  next r
!
  strt=tmr(3)
!
  xl=new("*obj/excel" for program)
  xl'CreateWorkBook("")
  xl'write(data$,"A1..Y1000")
  xl'visible=1
!
  print "Load time=",tmr(3)-strt," Seconds"
  escape


848
Programming / Re: ENVIRONMENT VARIABLE
« on: October 31, 2018, 08:25:10 PM »
There is no direct method to change the environment variables nor any way to change the environment variables used by PxPlus from within your session.

When any process starts on any OS, it is passed a list of environment variables.  It can change this list for any process that it starts, but its environment variable list is basically fixed.  Changing the environment list is done by simply passing a new modified list to whatever processes you spawn.

PxPlus itself does not offer the ability to change the list of environment variables it passes to spawned processes, however you could spawn a process which would change the environment list and pass this new/modified list to a process that it spawns.

849
Language / Re: Parameter Questions
« on: October 31, 2018, 08:33:09 AM »
Regarding the 'F,' parameter, it only impacts PRINT statements with format specifications, not the STR function.  Is that possibly what you are seeing?

->print 123456789.01:"##,###,##0.00"
Error #43: Format mask invalid
->x$=str(123456789.01:"##,###,##0.00")
Error #43: Format mask invalid
->set_param 'f,'
->print 123456789.01:"##,###,##0.00"
 123456789.01
->x$=str(123456789.01:"##,###,##0.00")
Error #43: Format mask invalid


The STR function has both an error branch and ability to provide an alternate output which is why the parameter is not used.  It could cause application logic problems.

850
Nomads / Re: change caption using titlebars
« on: October 30, 2018, 08:38:26 AM »
When we introduced these at the DireXions conference, we suggested that you start by copying an existing titlebar definition so that the control names and logic would be correct. 

Unfortunately the logic needs the controls in the header to have specific names otherwise it will not function correctly.

851
Web Services / Re: Error Compiling mod_inomads.c
« on: October 25, 2018, 11:30:04 AM »
I made some additional changes to the module and it now fully clean compiles on my Centos system (no warning)

I uploaded the new source to https://home.pvxplus.com/downloads/misc/mod_inomads.zip

Please give this one a try.

852
Wish List / Re: Enumeration Sequencing
« on: October 25, 2018, 10:57:55 AM »
James, have you considered creating a simple object to do this as in...

Code: [Select]
  def class "enum"
  function Integer(*)do_enum
  function Binary(*)do_enumbin
  end def
 !
 do_enumbin:
  bin=1
 do_enum:
  x$=stk(properties)
 !
  if x$="" \
   then return
 !
  if pos("N"^x$)<>0 \
   then def msg(201)="Non-numeric variable passed to function";
        exit 201
 !
  n=1
  for i=1 to len(x$)
  vars$+=",v"+str(i)
  vals$+=str(n)+sep
  if bin \
   then n=n*2 \
   else n++
  next
 !
  vars$=cpl("iolist "+vars$(2))
  enter iol=vars$
  read data from vals$ to iol=vars$
  return

It could then be used like this:

-:list
0010 BEGIN
0020 LET oEnum=NEW("enum" FOR PROGRAM)
0030 oEnum'Integer(a,b,c,d,e)
0040 oEnum'Binary(x,y,z)
0050 DUMP

-:run
! ERR=0, CTL=0, RET=2
! **********************************************************
! Level=1
! PGN="<Unsaved>"
!  Statement......0050
a=1
b=2
c=3
d=4
e=5
oEnum=100001
x=1
y=2
z=4


You could also add a 'Clear function to set all the values to 0 if desired in response to Thomas Bock's request

853
Nomads / Re: Folder Control
« on: October 25, 2018, 10:30:41 AM »
List boxes can be defined as "Smart" which means their contents will be loaded directly based on a query definition.  What you do is first create a Nomads query that defines the data you want loaded, then define this query as a Smart Load for the list box.  If desired you can specify triggers as to when the query is to run and/or be refreshed along with data to pass to the query so the contents can be filtered.

We did something like this in the "Bells and Whistles" portion (Part 5) of our Live in 30 video presentation on this forum.  While this was actually targeted for iNomads, the exact same logic works in plain Nomads as well.
(The Nomads screens in the video are from a prior release but the setup/functionality is the same on newer versions)


I am not certain what you asking about when you mention Folders, perhaps you can clarify.

854
Web Services / Re: Error Compiling mod_inomads.c
« on: October 22, 2018, 11:28:42 AM »
To avoid any confusion I have attached an updated mod_inomads.c to this posting

855
Web Services / Re: Error Compiling mod_inomads.c
« on: October 22, 2018, 10:57:56 AM »
Clay, the error appears to be that BOOL is not defined.

Please insert the lines in blue below around line 29 in mod_inomads.c

#include <unistd.h>

#if defined(BOOL)
#else
#define BOOL int
#endif


int MyMemicmp(const void *s1, const void *s2, size_t n)


You should then be able to re-compile.

Note: Due to some newer changes in the GCC compilers on Linux you will receive some warning messages but they will not prevent the logic fro compiling/working.

Pages: 1 ... 55 56 [57] 58 59 ... 65