PxPlus User Forum

Twitter Twitter Twitter

Author Topic: @(X),@(Y)  (Read 1100 times)

Gilles

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
@(X),@(Y)
« on: June 22, 2020, 08:36:23 AM »
Just by curiosity (this is an old Providex release 9.1)

PRINT (IMP)'FONT'("Arial",-12,"B"),'TEXT'(@X(0),@Y(L),@X(112),@Y(L),UCS(TITRE$),"L"),; L++
This line is running from Windx but causes an error 13 when running in background (cron on Linux)
To make it work in background, we have to modify like this:
24480 PRINT (IMP)'FONT'("Arial",-12,"B"),'TEXT'(@X(0,IMP),@Y(L,IMP),@X(112,IMP),@Y(L,IMP),UCS(TITRE$),"L"),; L++

IMP is *PDF*

Any idea?


Stéphane Devouard

  • Diamond Member
  • *****
  • Posts: 122
  • PxPlus guru with skills in PHP, JS, C#, Java
    • View Profile
    • Stéphane's Web Resume
Re: @(X),@(Y)
« Reply #1 on: June 22, 2020, 09:14:08 AM »
Gilles

@X() and @Y() do their calculation based on the channel passed to them as the 2nd parameter, or 0 (terminal) if no channel is passed
When running as cron, I guess the stdout and stderr are redirected either to /dev/null or to some other file (a log file maybe ?) which explains the issue
In any case, you should always base the @X() and @Y() calculation on the actual output channel

Regards
Stéphane Devouard
Portfolio | Work

Gilles

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
Re: @(X),@(Y)
« Reply #2 on: June 22, 2020, 10:38:47 AM »
Thank you Stéphane, that makes sense.